modified avoidance routine