How is the settlement calculated when the agreement ends?