Implemented n-depth-tree successfully