working on resampling functionality