Exercise 3.3 resolved