passing all other tests with existing code
refactoring method of summing hamming distance