14. COMMITMENTS AND CONTINGENCIES ? Operating Leases ? The company leases certain facilities, equipment and parcels of land under agreements that expire at various dates. For accounting purposes, rent expense is based on a straight-line amortization of the total payments required over the lease. The company incurred lease expenses of $ 9.0 million and $29.7 million during the three and nine months ended September 30, 2018 , respectively, and $11.2 million and $33.4 million during the three and nine months ended September 30, 2017 , respectively. ? Aggregate minimum lease payments under these agreements for the remainder of 2018 and in future years are as follows (in thousands): ? ? ? ? Year Ending December 31, Amount ? 2018 $ 9,989 ? 2019 24,808 ? 2020 18,052 ? 2021 10,574 ? 2022 8,252 ? Thereafter 32,245 ? Total $ 103,920 ? Commodities ? As of September 30, 2018 , the company had contracted future purchases of grain, corn oil, natural gas, crude oil, ethanol, distillers grains and cattle, valu ed at approximately $ 411.9 million. ? Legal ? In November 2013, the company acquired two ethanol plants located in Fairmont, Minnesota and Wood River, Nebraska. There is ongoing litigation related to the consideration for this acquisition. On August 19, 2016, the Delaware Superior Court granted Green Plains motion for summary judgment in part and held that the sellers attempt to disclaim liability for certain shortfall amounts through the use of a disclaimer provision was ineffective. Based on the court order, the company determined that previously accrued contingent liabilities of approximately $6.3 million no longer represented probable losses. These accruals were reversed as a reduction of cost of goods sold during the year ended December 31, 2016, because the adjustment relates to a reduction in the cost of inventory purchased in the acquisitions. Per the courts direction, the company and the seller retained an independent accounting firm to determine if a shortfall exists and the precise shortfall due to Green Plains. The accounting firm has concluded that a shortfall does exist consistent with the companys calculations, and the matter is now back in the hands of the Court to review and enter its order. On October 30, 2018, the ongoing litigation was settled and will be recorded in the fourth quarter. ? In addition to the above-described proceeding, the company is currently involved in litigation that has arisen in the ordinary course of business, but does not believe any pending litigation will have a material adverse effect on its financial position, results of operations or cash flows.