complete chapter6 of ALG and add example for chapter6.