Solving problem 87