improve random operations