Exercise 4.3 resolved