private void GoToNextNode() { if (stack.Count == 0) { currentNode = null; } else { indexInsideNode = 0; currentNode = stack.Pop(); GoToLeftMostLeaf(); } }