cost calculation corrected