Made the hamming method a little more efficient.