Implement goal avoidance code