Attempt at Exercise 9