loop based sampler 