Solved problem 15 in two different ways