new version of CostCalculator