fixes hamming function.