working on problem 9