Exercise 4.2.4 - fixed errors