fix errors to end of chapter 3