Added code examples for chapter 6.1, 6.3, 7.4