fix code errors in chapter 11