wrote sampler function -- testing