add option for a reduce stage in ranSampler