constructing AVL tree