Add solution for exercise 17.