Add solution for exercise 6.9