chapter 2 exercises, up to exercise 9