Fixed weird $cost calculating code done in a fugue, I guess. Resolved issue #19.