trying to debug get_cost()