wierd problem - b16a2

ok, my swaps done. been driving to check for anything different, first, when it starts up, it idles really low, jumping between 250 and 1000 for about ten seconds and then idles fine. then, ill be driving fine, and certain times when the brakes are not eased down very softly, when it comes to a stop, the rpm’s drop down to 0, and it shuts off. i know the vaccume hoses for the mass air flow sensor need to be hooked up some how with my cai. i dont know how exactly how to hook those up, and that would solve a problem. ALSO ive called some local shops, and people i know and have never heard of this problem before… theres a wire on the distributor that needs to be grounded for the engine to even fire. so i have that wire grounded(i think its the TDC sensor) and i think thats another problem… if anyone has info or a solution to my problems id be very appreciative. thanks for everything. :bow: