section 965 , and (B) by inserting and inclusions after certain distributions in the heading thereof. (2) Paragraph (3) of section 245(a) is amended— (A) by striking post-1986 in subparagraph (A), and (B) by striking total post-1986 in subparagraph (B). (3) Paragraph (4) of section 245(a) is amended to read as follows: (4) Undistributed earnings The term undistributed earnings means the amount of the earnings and profits of the controlled foreign corporation (computed in accordance with sections 964(a) and 986)— (A) as of the close of the taxable year of the controlled foreign corporation in which the dividend is distributed, and (B) without diminution by reason of dividends distributed during such taxable year. . (4) Paragraph (5) of section 245(a) is amended— (A) by striking post-1986 both places it appears in the matter preceding subparagraph (A), and (B) by striking Post- 1986 undistributed in the heading thereof and inserting Undistributed . (5) Paragraph (6) of section 245(a) is amended— (A) by striking beginning after December 31, 1986 and inserting which is after the first taxable year of such corporation , and (B) by striking post-1986 both places it appears. (6) Paragraph (2) of section 6601(b) is amended— (A) by striking section 6156(a) in the matter preceding subparagraph (A) and inserting section 965(d)(1) or 6156(a) , and (B) by striking section 6156(b) in subparagraph (A) and inserting section 965(d)(2) or 6156(b), as the case may be . (7) The table of sections for subpart F of part III of subchapter N of chapter 1 is amended by striking the item relating to section 965 and inserting the following: Sec. 966. Inclusion of previously deferred foreign income. . (d) Effective date (1) In general Except as provided in paragraph (2), the amendments made by this section shall apply to the last taxable year of foreign corporations beginning before the applicable date, and to taxable years of United States shareholders with or within which such taxable years of foreign corporations end. (2) Conforming