some work on resampling