Added a solution to exercise 9