Problem 9 working