solution for exercise 5.2