I have a E39 535i, 1997 model. I recently replaced the engine (M62). All was going well for about a week after engine replacement, then 2 days ago I was driving and the car started losing power. By losing power I mean losing spark, I'd be driving and the tachometer would drop to zero and I'd have no acceleration, all other electrics would stay on, this would last for about two seconds and then I'd get power back. I have noticed this only happens when the engine is warm, driving for at least 5 kilometers. also when the engine is warm it does stall when I come to a stop and it restarts sometimes first go and sometimes it takes two or three restarts. If I leave it off until the engine cools down it runs without incident for about five kilometers. I have cleaned the ICV, the ICV is my original one and it never gave me trouble before, same for the MAF sensor. Any Ideas what could be causing this issue?