Solving problem 21