Calculation of Revenue Function