new randomize function