add some codes of ch6