improvements to sampler