what is wrong when you get the code p0401 and p0420 and you change and clean egr on 1997 Saturn SW2

egr and o2 sensor was change but we're still getting a code vehicle runs good what need to be done

Asked by for the 1997 Saturn SW2
The P0401 code is for the insufficient EGR flow. It does not mean that your EGR valve needs to be replaced. It might be just the EGR ports are clogged . Its needs to be cleaned first before replacing EGR valve.
P0420 code shows that your catalytic converter does not work as it supposed to . You should try a chemical first to clean converter if it wont help then converter needs to be replaced.