inserting with rebalancing