Completed problem 9