1. fix filtering
2. sort data by time to handle data points that arrive out of order (because of request latencies)