modified so that could plug in previous two days data