Added code examples from Chapter 8