Added ability to use historical data