solution for exercise 2