Exercise 6.1, first pass