Added the solution to part 3 of the homework