Homework 2 part 3 first attempt