Exercise 2.5 resolved