Exercise 10.5 solved