rewrote insert procedure in rebalance