procedure tree recalculate