Solved problem 2, part 1