the end of clause (iii) and inserting , or , and by inserting after clause (iii) the following: (iv) the production, refining, transportation, or distribution of oil, natural gas, or any primary product (within the meaning of section 927(a)(2)(C), as in effect before its repeal). . (b) Conforming amendment Section 199(d) of such Code is amended by striking paragraph (9) and by redesignating paragraph (10) as paragraph (9). (c) Effective date The amendments made by this section shall apply to taxable years beginning after December 31, 2017. 5. Repeal of percentage depletion for oil and gas (a) In general Section 611(a) of the Internal Revenue Code of 1986 is amended by striking oil and gas wells . (b) Conforming amendments (1) Section 613 of such Code is amended by adding at the end the following: (f) Termination relating to oil and gas This section shall not apply with respect to any oil or gas well in taxable years beginning after December 31, 2017. . (2) Part I of subchapter I of chapter 1 of the Internal Revenue Code of 1986 is amended by striking section 613A (and by striking the item relating to such section in the table of sections for such part). (c) Effective date The amendments made by this section shall apply to taxable years beginning after December 31, 2017.