new resample mechanism