working on example from chapter 2