modified stage 6 to remove redudant steps