The codes are numbered the way they are to give you some idea which problem to address first. This minimizes interactions doing it in that order. And sometimes higher number codes will automatically be fixed when the lower number one is. So ask you shop to start by fixing the problem causing the lowest numbered code; i.e. p0401, the EGR problem. You might have a faulty egr valve, or the vacuum control which control how far it is supposed to open it is broken. If I had that problem on my Corolla first thing I’d do is verify the egr valve holds vacuum ok. EGR valves have a flexible rubber diaphragm in them which sometimes over time develops a leak. If it held vacuum, next thing I’d do is verify when full intake manifold is applied to it at warm idle, doing that stalls the engine. That will verify the EGR valve is capable of moving through its full range.