adding time series code