added searching for cost, but does not work