sampler_hd function

Customised sampling function wrapper