fixed hw4 part 3