Exercise 2.4 resolved