resample() almost working