Add calculateHammingDistance