Exercise 3.16 resolved