Exercise 4.5.3 - fixed errors