fixed a completely broken random number generator.