Solved exercise 2.1