fix problems in chapter12