This car's known for your issue; mine does it, too. It is not an easy fix. Some have suggested flashing (i.e., reprogramming) the Engine Control Unit (ECU), but it's no sure fix and can be expensive, so I've heard. Cleaning the Mass Airflow Sensor (MAF) works for some, but again it's no sure thing. Your description does NOT seem to indicate the need for engine replacement. Have the dealer check the engine timing (that is, the "static" timing at idle, as well as the on-board computer's dynamic adjustment of the timing when the engine is run at a higher, say 2,000, rpm level and ensure it's OK. Do your due diligence, but expect to have to live with this issue, as many of us owners on the Web have complained about!