Change sampler function