Significantly improved random number functions