Temp Code optimization and rebalance trees temp grow