Added threshold crossing detections.