added gamma distribution resampling