     
     /// - returns: `true` if there is no parent. Otherwise, `false`.
     var root: Self {
+        
+        func ascendToGetRoot(of node: Self) -> Self {
+            
+            guard let parent = node.parent else {
+                return node
+            }
+            
+            return ascendToGetRoot(of: parent)
+        }
+        
         return ascendToGetRoot(of: self)
     }
     

        return ascendToGetPathToRoot(of: self, result: [])
    }
    
    fileprivate func ascendToGetRoot(of node: Self) -> Self {
        guard let parent = node.parent else { return node }
        return ascendToGetRoot(of: parent)
    }
    
    /**
     - returns: `true` if the given node is an ancestor. Otherwise, `false`.
     */
    func hasAncestor(_ node: Self) -> Bool {
        return self === node ? false : pathToRoot.anySatisfy { $0 === node }
    }
    
    /**
     - returns: Ancestor at the given distance, if present. Otherwise, `nil`.
     */
    func ancestor(at distance: Int) -> Self? {
        
        guard distance < pathToRoot.count else {

        try removeChild(at: index)
    }
    
    /// Remove the node at the given `index`.
    ///
    /// - throws: `MutableTreeError.removalError` if `index` is out of bounds.
    func removeChild(at index: Int) throws {
        
        guard children.indices.contains(index) else {
