Add and implement validateCost()