Random number algorithmn.