Updated resampling functions