fixed a small bug in the hamming distance