Added total cost code.