updated cost calculation