Oops, my comment was written before I saw the latest replies, ignore me :)

+1 for "store the original value of min_cost"