Chapter 6 and small fix to chapter 1