improve the random position's producting method