write inOrder traversal and not working max depth