Adding chapter6 preliminary code and some tests