restructure method aded to AVL tree