Added code examples from Chapter 6