hamming distance and premutation methods working