fix cost calculator.