added timing and randomization