cleaning/optimizing
invert resampling+fixes