part 3 of assignment 3 debug