problem with idle...

So I just swaped a b18b1 and the idle keeps going up to 3000 rpm and down repeatedly… anybody know what could cause it to do that

try cleaning the IACV(Idle air control valve) it’s located on the back of the intake manny, it has two coolant hoses coming from it. if thats not it check your vaccums…