Update sampling.r