added AVL rebalancing