add frequency to calculation.