Algorithm changed to return semi-random numbers