project2: changes to make project compile/run properly; fixed pseudocode to be more clear