(a)(2)(B)(i) in the case of the exchange of multiple pieces of real property by related persons. . (d) Conforming amendments (1) Subsection (b) of section 1031 of the Internal Revenue Code of 1986 is amended— (A) by striking in kind .—If an exchange and inserting “ in kind .— (1) In general If an exchange , and (B) by adding at the end the following new paragraph: (2) Coordination with subsection (a)(2)(B) In the case of an exchange to which paragraph (1) applies— (A) paragraph (1) shall be applied before the application of subsection (a)(2)(B), and (B) subsection (a)(2)(B) shall be applied— (i) as if such exchange were within the provisions of subsection (a), and (ii) by increasing the basis of the property disposed of by the taxpayer in such exchange by the amount of any gain determined under paragraph (1). . (2) Subsection (d) of section 1031 of such Code is amended by striking in the amount of gain and inserting in the amount of gain (including any gain recognized by reason of subsection (a)(2)(B)(i)) . (3) Subsection (i) of section 1031 of such Code is amended by striking (a)(2)(B) and inserting (a)(2)(A)(ii) . (e) Effective date The amendments made by this section shall apply to exchanges completed in taxable years beginning after December 31, 2016. 7. Contribution limit and increased minimum distributions for certain retirement plans with large account balances (a) Contribution limit (1) In general Subpart A of part I of subchapter D of chapter 1 of the Internal Revenue Code of 1986 is amended by adding at the end the following: 409B. Contribution limit on certain retirement plans with large account balances (a) General rule Notwithstanding any other provision of this title, no applicable annual additions shall be made by, or on behalf of, an individual for the taxable year to any applicable retirement plan to the extent such applicable annual additions exceed the excess (if any) of— (1) the applicable dollar amount for the taxable year, over (2) the aggregate balances to the credit of the individual