Adding computeCosts operation.