Improved random number generator