Fixed chap06 code.