exercise 6.3~6.6
complete chapter 6