added resampling to test6