More work on chapter 5, grouping patterns
More work on chapter 5, fixed up code examples and formatted text.