Modified random number generator