complete examples from chapter 7