completed script to calculate hamming distances.