Year Ended December 31, 2019 and 2018
Year Ended December 31, | |||||||
(in thousands) | 2019 | 2018 | |||||
Cash flows from operating activities: | |||||||
Net loss | $ | (69,632 | ) | $ | (45,263 | ) | |
Adjustments to reconcile net loss to net cash provided by operating activities: | |||||||
Depreciation and amortization | 50,396 | 59,293 | |||||
Stock-based compensation | 23,587 | 29,253 | |||||
Provision for bad debts | 1,308 | 1,824 | |||||
Loss on the disposition of property, equipment and other assets | 2,282 | — | |||||
Provision for deferred income taxes | (3,354 | ) | (2,990 | ) | |||
Impairment of assets | 1,728 | 1,998 | |||||
Changes in operating accounts: | |||||||
Accounts receivable | 15,071 | 599 | |||||
Inventories | 18,447 | (34,035 | ) | ||||
Prepaid expenses and other current assets | 9,150 | 40,922 | |||||
Accounts payable | (16,846 | ) | 11,559 | ||||
Deferred revenue and customer deposits | 677 | (2,383 | ) | ||||
Accrued and other current liabilities | 960 | (47,851 | ) | ||||
All other operating activities | (2,193 | ) | (8,130 | ) | |||
Net cash provided by operating activities | 31,581 | 4,796 | |||||
Cash flows from investing activities: | |||||||
Purchases of property and equipment | (23,985 | ) | (40,694 | ) | |||
Proceeds from sale of assets | 1,620 | 333 | |||||
Purchase of noncontrolling interest | (2,500 | ) | — | ||||
Other investing activities | (2,007 | ) | (1,466 | ) | |||
Net cash used in investing activities | (26,872 | ) | (41,827 | ) | |||
Cash flows from financing activities: | |||||||
Proceeds from borrowings | 100,000 | 25,000 | |||||
Repayment of borrowings/long term debt | (76,768 | ) | — | ||||
Payments related to net-share settlement of stock based compensation | (3,194 | ) | (7,367 | ) | |||
Payments on earnout consideration | — | (2,675 | ) | ||||
Other financing activities | (1,338 | ) | (694 | ) | |||
Net cash provided by financing activities | 18,700 | 14,264 | |||||
Effect of exchange rate changes on cash, cash equivalents and restricted cash | 289 | (3,145 | ) | ||||
Net increase (decrease) in cash, cash equivalents and restricted cash | 23,698 | (25,912 | ) | ||||
Cash, cash equivalents and restricted cash at the beginning of the period a | 110,919 | 136,831 | |||||
Cash, cash equivalents and restricted cash at the end of the period a | $ | 134,617 | $ | 110,919 |
<