solving problem 32