Consolidated Statements of Cash Flows The following table details the items contributing to the changes in cash and cash equivalents and restricted cash for fiscal years ended September 30, 2019, 2018 and 2017: The following table details the items contributing to Net Cash Provided By Operating Activities for the fiscal years ended September 30, 2019, 2018 and 2017: The increase in net cash provided by operating activities for the fiscal year ended September 30, 2019, as compared to the same period in fiscal year 2018, was primarily due to (i) an increase in net income which was primarily driven by increased citrus sales and the receipt of federal disaster relief funds relating to Hurricane Irma, and (ii) an increase in working capital, which is due to a decrease in accounts receivable and an increase in income taxes payable. The decrease in net cash provided by operating activities for the fiscal year ended September 30, 2018, as compared to the same period in the fiscal year 2017, was primarily due to the effect of the Company recognizing a greater gain on the sale of real estate, 35 (in thousands) Fiscal Year Ended September 30, Fiscal Year Ended September 30, 2019 2018 Change 2018 2017 Change Net income (loss) $ 37,450 $ 12,800 $ 24,650 $ 12,800 $ (9,496 ) $ 22,296 Deferred gain on sale of sugarcane land — (967) 967 (967) (538) (429) Depreciation, depletion and amortization 13,924 13,756 168 13,756 15,226 (1,470 ) Loss on breeding herd sales — 13 (13) 13 337 (324) Deferred income tax expense (benefit) 3,267 (1,955 ) 5,222 (1,955 ) (3,948 ) 1,993 Cash surrender value 11 (27) 38 (27) (15) (12) Deferred retirement benefits 829 (41 ) 870 (41 ) (102 ) 61 Magnolia Fund undistributed loss (earnings) — (8) 8 (8) 202 (210) Gain on sale of real estate, property and equipment and assets held for sale (13,166 ) (10,281 ) (2,885 ) (10,281 ) (1,373 ) (8,908 ) Inventory net realizable value adjustment 808 1,115 (307) 1,115 1,199 (84) Inventory casualty loss — — — — 13,489 (13,489 ) Loss on disposal of property and equipment — 207 (207) 207 — 207 Change in fair value of derivatives 989 — 989 — — — Impairment of long-lived assets 396 2,234 (1,838) 2,234 9,346 (7,112) Non-cash interest expense on deferred gain on sugarcane land — 1,361 (1,361 ) 1,361 1,413 (52 ) Insurance proceeds received for damage to property and equipment (486) (477) (9) (477) — (477) Bad debt expense — 24 (24 ) 24 312 (288 ) Stock-based compensation expense 824 2,613 (1,789) 2,613 1,653 960 Change in working capital 3,986 (1,789 ) 5,775 (1,789 ) (224 ) (1,565 ) Net cash provided by operating activities $ 48,832 $ 18,578 $ 30,254 $ 18,578 $ 27,481 $ (8,903) (in thousands)  Fiscal Year Ended September 30, 2019 2018 2017 Net cash provided by operating activities $ 48,832 $ 18,578 $ 27,481 Net cash (used in) provided by investing activities (4,960) 22,924 (9,337) Net cash used in financing activities (52,294 ) (12,637 ) (21,374 ) Net (decrease) increase in cash and cash equivalents and restricted cash $ (8,422) $ 28,865 $ (3,230) Net Cash Provided By Operating Activities