fix incorrect assumpton about math.random()