Actually implement setting of cost.