Made difference() much faster, 10x speed improvement (now runs at close to 1 million hashes/second/core on my machine)