Finished problem 9