Added console.log for totalCost