; (2) in subsection (b)— (A) in paragraph (1), in the matter preceding subparagraph (A), by inserting resource after carry out distributed energy ; (B) in paragraph (2), by striking subsection and inserting section ; and (C) in paragraphs (3) and (4) (as redesignated by paragraph (1)), by striking subsection (b) each place it appears and inserting this subsection ; (3) by redesignating subsection (b) as subsection (h); (4) in subsection (a), by striking the subsection designation and heading and all that follows through The Secretary in the first sentence and inserting the following: (a) Definitions In this section: (1) Commission The term Commission means the Federal Energy Regulatory Commission. (2) Distributed energy resource The term distributed energy resource has the meaning given the term in section 2 of the Flexible Grid Infrastructure Act of 2017 . (3) Grid flexibility The term grid flexibility means the ability of a power system— (A) from an operational perspective, to respond to changes in supply and demand, such as abrupt changes in load conditions or sharp ramps in generation; and (B) from a long-term planning and investment perspective, to respond to changes in technology, markets and policy, without incurring stranded assets. (b) Research, development, demonstration, and commercial application (1) In general The Secretary ; (5) in subsection (b) (as so redesignated), in the second sentence, by striking The programs and inserting the following: (2) Requirement The programs under this subsection