revise to add formulas and counts