fixed some random number stuff