finished problem 9