working on problem 9
problem 9