begin solving problem 9