Implementing IStepCostFunction