finished chap06 and chap07