fixes to checkCost almost done