drafted AvlTree with new interface