added detrend