Partial code for part 3 of the assignment