fix bugs in iteration 3 codes
Merge pull request #152 from COMP231-S63G1/Iteration3FixBugs

fix bugs in iteration 3 codes