updated with time series implementation