made some great changes to random.

I need some help reviewing this code - i think it makes random better but I'm not sure about the hash function.