Refactored hamming to eliminate helper function and shorten naming conventions