tweaking hamming method