New anomaly detection algorithm