Exercise 10.13 partially solved