add hamming distance function and test