Exercise 10.1 resolved