i have been having trouble with my m5 ever since a rainy day about two months ago. While driving up the on ramp to the freeway my car choked and shut off. Upon trying to restart the car choked again and turned off. I had the car towed to the dealer. When the car got to the dealer i replaced the old nasty dinan air filters and hoped i didnt get any water in my engine. The next day car started up fine and ran good as new but when i went to crank it again after being warm it did the same as the day it cut off. finally the check engine light came on so we ran it on the machine and it came up with a misfire in all cylinders and a lean mixture code. didnt tell me much. i replaced the fuel pump and filter and checked the MAFS. still same problem . Then replaced the idle control valve, still same problem. the car only starts right sometimes. if the car is cold the car will start right up and run strong. once it warms up i will try to start is and the rpms will stay very low, under 1000 and just jump eventually cutting off. if i try to give it any gas it will usually bog down and cut off also. after a few trys the engine will start up like nothing was ever wrong. any suggestions?