edit chapter 06

to fix the parts that were different from the original book
edit chapter 06

because the code syntax spanning multilines cannot be compiled.