chapter 5 with tests