Working code that classifyes anomalies and errors separately