[ch6] exercises and some tests