changed random number generation algorithm, yay