added randomization feature