fixes to chapter 6