putting historical data in sorted set