Fix bug in chapter 3, add beginning of chapter 5