@Override
	public Node next() {
		if(currentNode == root){
			if(root.hasChildren() && stack.isEmpty()){
				children = root.getChildren();
				for(int i = children.size()-1; i >=0; i--){
					stack.push(children.get(i));
				}
				return root;
			}
			else if (!stack.isEmpty()){
				currentNode = stack.pop();
				return currentNode;
			}
		}
		
		if(currentNode.hasChildren()){
			children = currentNode.getChildren();
			if(currentNode != root && children.size() > 1) {
				for(int i = children.size()-1; i > 0; i--){
					stack.push(children.get(i));
				}
			}
			currentNode = children.get(0);
			return currentNode;
		} else {
			currentNode = stack.pop();
			return currentNode;
		}
	}