//Duplicate a node along with all children hierarchy
		static Node DuplicateBranch(BTNode root, Graph targetGraph){
			
			if (targetGraph == null)
				return null;

			var newNode = root.Duplicate(targetGraph);
			var dupConnections = new List<Connection>();
			for (var i = 0; i < root.outConnections.Count; i++)
				dupConnections.Add( root.outConnections[i].Duplicate(newNode, DuplicateBranch( (BTNode)root.outConnections[i].targetNode, targetGraph) ));
			newNode.outConnections.Clear();
			foreach (var c in dupConnections)
				newNode.outConnections.Add(c);
			return newNode;
		}