Working on historical data script