Solving problem 10