price of the accounts receivable based on the age of the accounts receivable when collected. We are also charged for certain reimbursable administrative fees incurred on our behalf for the management of the program. In connection with the Factoring Agreement, we entered into a Security Agreement, granting to Versant a security interest in substantially all of our assets to secure our obligations under the Factoring Agreement.
The Factoring Agreement was terminated on June 30, 2021. Factoring fees paid under this arrangement totaled approximately $298,000 for the year ended December 31, 2021. Upon termination of the Factoring Agreement, all future payments of accounts receivable shall be made directly to the Company.
Note Payable Loan Forgiveness
On January 13, 2021, the Paycheck Protection Program Loan and related interest of $788,156 was fully forgiven by the U.S. Small Business Administration.
Cash Flows
Operating Activities
For the year ended December 31, 2021, net cash used in operating activities was approximately $10,668,410, which consisted of a net loss of $8,961,815 offset by non-cash charges of approximately $3,576,000, which primarily includes a $2,740,425 loss on extinguishment of Bridge Notes, $958,639 related to amortization of internally developed software, $869,600 of amortization of discount on Amended Bridge Notes, $622,064 in stock based compensation, a $260,185 loss on extinguishment of Convertible Notes, $161,074 in bad debt expense, $45,358 related to depreciation and amortization of property and equipment, $12,500 in of common stock issued in exchange for services, $4,605 of amortization of debt issuance costs on note payable, and $1,088 of amortization of discount and debt issuance costs on Convertible Notes, partially offset by a $1,311,700 loss on derivative liabilities, and a $788,156 gain on extinguishment on note payable.
Total changes in assets and liabilities of approximately $5,282,000 were primarily driven by a $1,708,922 decrease in accrued interest, a $1,637,124 increase in accounts receivable, a $1,086,259 increase in accounts receivable-unbilled, a $959,754 decrease in accounts payable, and a $218,508 decrease in deferred revenue, offset by a $198,893 increase in accrued expenses, a $90,894 decrease in prepaid expenses and other current assets, and a $38,503 decrease in tax credit receivable.
For the year ended December 31, 2020, net cash used in operating activities was $288,380, which consisted of a net loss of $4,652,084 offset by non-cash charges of approximately $1,323,000 which primarily includes $774,929 related to amortization of internally developed software, a $159,000 loss on derivative liability, $143,435 of amortization of discount and debt issuance costs on Convertible Notes, $108,096 in bad debt expense, $92,866 in stock based compensation, and $44,758 related to depreciation and amortization of property and equipment.
Total changes in assets and liabilities of approximately $3,041,000 were primarily driven by a $1,951,429 increase in accrued interest, an increase of $1,054,638 in accounts payable, an increase of $873,254 in deferred revenue, an increase in accrued expenses of $282,142, and a decrease in tax credit receivable of $104,624, offset by a $800,908 increase in accounts receivable, a $226,374 increase in prepaid expenses and other current assets, and an increase in accounts receivable-unbilled of $198,185.
Investing Activities
Net cash used in investing activities was $1,037,917 and $1,102,612 for the years ended December 31, 2021 and 2020, respectively. Net cash used in investing activities for the year ended December 31, 2021 consisted of $1,035,367 of capitalization of internally developed software and $2,550 for purchase of property and equipment. Net cash used in investing activities for the year ended December 31, 2020 consisted of $1,102,186 of capitalization of internally developed software, and purchases of property and equipment of $426.
Financing Activities
Net cash provided by financing activities was $38,749,397 and $2,033,008 for the years ended December 31, 2021 and 2020, respectively. Net cash provided by financing activities for the year ended December 31, 2021 consisted of $20,999,988 of proceeds