Added more code examples for chapter 4