Exercise 3.11 resolved