fix bugs
Merge branch 'lab3' of https://github.com/dlisuk/cse223b_lab3 into lab3