So I just bought a 1998 Z3, which originally came with the 1.9, but previous owner swapped a 3.2 into it. It has also been sitting for 2 years, so I put in stp fuel treatment, gum out fuel system cleaner, octane booster, and filled it up with 91 (it has just under 1/8th tank of old gas). The car will start and instantly die. If I rev it up it slowly goes up hesitantly but still as soon as i let of it dies. If i unplug the maf sensor it will stay running but will not go above like 1200-1500 rpm in park. When in drive it's about the same and still hesitant to go up to that. The exhaust manifold gasket is bad, and was told it's not actually missing a few nits holding the manifold on, so it may even be loose. I hooked up my bmw scanner and the codes it comes up with under DME are E - intake air temperature sensor, 3E Secondary air system, switching valve, 15- VANOS (solenoid), and 4F AfterCat oxy sensor heater, Cyl #1-3. I thought maybe the maf sensor was bad but I got one from a junkyard today and it mad no difference. It's also spitting oil out of the exhaust. It's not smoking out of the exhaust, but it is a little bit from under the hood. I'm thinking this may be bc of oil leaking from outside of the engine into the exhaust manifold bc of it not being on all the way or something but I still feel like it would burn. Theres also a rattling/knocking kind of noise inconstistantly happening from the center of the exhaust, in thinking maybe a broken part in the cat. Tomorrow I will be letting it run and maybe it's just the injectors are clogged too much still and wont allow for that extra fuel to flow out but any help as to what could be going on would be greatly appreciated. I tried to post as much as I could think of about it. Also I'm not 100% it is the 3.2, I'm not sure exactly where to look on the engine for the engine code.