sgw: the costs are signed numbers