Fix poor hashing method, multiplying by the same prime number results in
large number of hash collisions with linear distribution.
Also removes unnecessary object allocation, and simplifies logic to 1
step.