Exercise 3.15 resolved