update ruby hamming with clearer, more concise code