Simplified and added proper loop detection for Organizational relationships