added oscillation warning and avoidance