Exercise 3.6.2 - fixed errors