generic sampler