Exercise 10.12 solved!