Homework 2 solved part 2