Fixed avoidance algorithm (v3)