Exercise 3.19 resolved