Add solution for exercise 6.10