how does an egr work