handle total cost display for cost matrix