working dynamic sampling