Exercise 4.5b finished