impelementing AVL tree