fix cost fun