Exercise 10.3 resolved