add hamming method