update getCost (doesn't work)