Add rolling histogram and factor out anomaly detection

Function comment