End of hw4 part 2