Hello and welcome to justanswer.com
You most likely have a vacuum leak. This will cause the poor running as well as those lean codes.
I see issues with the intake manifold gasket seals as well as the vacuum lines under the throttle.
Listen for a hissing noise with the engine running.
Also if your scan tool can read live data you can monitor the fuel trims and spray some carb cleaner around the intake and vacuum lines.
why spray carb cleaner??
If you have an engine vacuum leak the engine is drawing in un metered air. Wen sparying the carb cleaner if the engine rpm changes then you find the spot of the leak.
As the engine will suck in the carb cleaner richening it up.
what if this is not a vacume leak. what other problems could it be
It can be low fuel pressure from a weak pump or clogged filter.
It is either a lack of fuel or un metered air since you already replaced the mass air flow sensor.
i have starting fluid... will that work
Yes that will work
i sprayed around my egr valve and the engin reved up... my buddy said i colud return the mass air flow senser if that wasn't the problem... should i keep it or take it back??
You may have a leaking EGR or there are gaskets on the valve and that tube that can be leaking.
there is a tube that goes from right past the mass air senser and conects to the top of my head... the rubber is broken... is this a vacume leak also??
Yes any air leak after the sensor is unmetered air (vacuum leak).
You can upload me a pic using the tree icon on the toolbar above where you type.
i replaced all of that.... still running rough... any other ideas
cant find any more leaks
We use a smoke tester to pinpoint any leaks. If you can get your hands on a scan tool that reads pids or live data it will help us.