Exercise 3.14 resolved