Add solution for exercise 5.4