Solving problem 13