tax is being computed as provided in paragraph (1), are sold or otherwise disposed of, then paragraph (1) shall not apply with respect to any subsequent payments on such accounts (other than subsequent payments on returned accounts with respect to which credit or refund is allowable by reason of section 6416(b)(5)), but instead— (A) there shall be paid an amount equal to the difference between— (i) the tax previously paid on the payments on such installment accounts, and (ii) the total tax that would be payable if such installment accounts had not been sold or otherwise disposed of (computed as provided in paragraph (1)), except that (B) if any such sale is pursuant to the order of, or subject to the approval of, a court of competent jurisdiction in a bankruptcy or insolvency proceeding, the amount computed under subparagraph (A) shall not exceed the sum of the amounts computed by multiplying— (i) the proportionate share of the amount for which such accounts are sold that is allocable to each unpaid installment payment, by (ii) the rate of tax under this chapter in effect on the date such unpaid installment payment is or was due. (3) Limitation The sum of the amounts payable under this subsection in respect of the sale of any article shall not exceed the total tax. 5904. Exemption from tax (a) Exemption from tax Cannabis products on which the internal revenue tax has not been paid or determined may, subject to such regulations as the Secretary shall prescribe, be withdrawn from the premises of any producer in approved containers free of tax and not for resale for use— (1) exclusively in scientific research by a laboratory, (2) by a proprietor of a cannabis production facility in research, development, or testing (other than consumer testing or other market analysis) of processes, systems, materials, or equipment, relating to cannabis or cannabis operations, under such limitations and conditions as to quantities, use, and accountability as the Secretary may by regulations require for the protection of the