updated. added code for anomaly prediction