Add solution for exercise 5.12