Updated cost and length.