updated pseudocode and code as well as my reflection.