inorder traversal using a stack