Exercise 2.2 resolved