rewrite bst as AVL tree
merge from home