solution for hw 2 part 3 7517427