Exercise 3.25 resolved