Exercise 5.4: done