When I accerate the car will surge and the engine check light comes on on 2007 Mini Cooper S

Also if I have to set in traffic for a long period it will start missing and some times ouit, but if I shut it off for 30 seconds or more then start it back up it runs ok.

3 answers 2 comments
Does the check engine light leave a code for a possible MAF, or reduced air flow?
No code appears when check engine light comes on
If the light is on there is a code in one module or another. Have fixed several Minis. They have different problems I want to give you the right information so I need the code. Try a profession scanner not a code reader.
please scan codes and post so we can adv.auto zone may not be able to retrieve codes on this car.you may need a good scanner from a mechanic
high pressure fuel pump went bad on my 2007 s mini cooper. covered under warranty up to 100,000 miles by the dealer. would sputter and stall three or four times then motor light would come on indicating 1/2 power. dealer will takew care of this as well as turbo heatshield. mike