updated resampling.pl