Exercise 3.24 resolved