i had the same symptoms on my old buick, a 3.3L v-6. Mass air flow sensor fixed that problem. We went through 3 of them before we finally got a good one. After the second one i finally got fet up and took it somewhere, they lightly tapped on the MAS and the engine started runnign completely differant, he then closed the hood, wiped his hands, and said "thats your problem". I then told him it was brand new and it was the second one and he shook his head and said again "thats the problem". I said ok, replaced it again(luckily they had a good return policy). INstalled it there, low and behold, no more check engine light(for a week at least, thats another story) and the car idled great. sorry for rambling
96 integra SE....sold
99 a4 quattro....sold
2004 highlander limited....current.