improved randomization