chapter 8, higher order functions