added some test logic to support time series analysis