as of the date of death, and (ii) an amount equal to the fair market value of the assets in such account on such date shall be includible if such person is not the estate of such beneficiary, in such person’s gross income for the taxable year which includes such date, or if such person is the estate of such beneficiary, in such beneficiary’s gross income for the last taxable year of such beneficiary. (f) Loans treated as distributions For purposes of this section— (1) In general If during any taxable year a participant or beneficiary receives (directly or indirectly) any amount as a loan from a portable retirement and investment account, such amount shall be treated as having been received by such individual as a distribution from such account. (2) Exception for certain loans (A) General rule Paragraph (1) shall not apply to any loan to the extent that such loan (when added to the outstanding balance of all other loans from such account), does not exceed the lesser of— (i) $50,000, reduced by the excess (if any) of— (I) the highest outstanding balance of loans from the account during the 1-year period ending on the day before the date on which such loan was made, over (II) the outstanding balance of loans from the plan on the date on which such loan was made, or (ii) the greater of— (I) one-half of the amount in the account, or (II) $10,000. (B) Requirement that loan be repayable within 5 years (i) In general Subparagraph (A) shall not apply to any loan unless such loan, by its terms, is required to be repaid within 5 years. (ii) Exception for home loans Clause (i) shall not apply to any loan used to acquire any dwelling unit which within a reasonable time is to be used (determined at the time the loan is made) as the principal residence of the participant. (C) Requirement of level amortization Except as provided in regulations, this paragraph shall not apply to any loan unless substantially level amortization of such loan (with payments not less frequently than quarterly) is required over the term of the loan.