Fixed some of the psuedocode.