Added a pass and removed some redundant code