Added solution to part 2

Added the solution to part 2 of the assignment