trying to convert to AVLTree