added nearest-neighbour resampling method