minor code clean up, completed hamming for ch6