generalized resampling methods