added part of the resambling