update formulas code