; and (B) at the election of any eligible entity that receives a loan under subparagraph (A), a grant in accordance with paragraph (10). ; (C) in paragraph (2)— (i) in the paragraph heading, by inserting for loans after Requirements ; and (ii) in subparagraph (A)(i), by striking that is ; (D) in paragraph (5)— (i) by redesignating subparagraphs (A) and (B) as clauses (i) and (ii), respectively, and indenting the clauses appropriately; (ii) in the matter preceding clause (i) (as so redesignated), by striking With respect to a loan under paragraph (1) and inserting the following: (A) In general Subject to subparagraph (B), with respect to a loan under paragraph (1)(A) ; and (iii) by adding at the end the following: (B) Extensions The Secretary may extend the term of a loan under subparagraph (A)(i), or the deadline for the repayment of an advance under subparagraph (A)(ii), as the Secretary determines to be appropriate. ; (E) in paragraph (7)— (i) in subparagraph (B), by striking paragraph (1) and inserting paragraph (1)(A) ; and (ii) in subparagraph (C), in the matter preceding clause (i), by striking Repayment of the special advance and inserting Subject to an applicable extension under paragraph (5)(B), repayment of a special advance under this paragraph ; (F) in paragraph (8), by striking paragraph (1) and inserting paragraph (1)(A) ; and (G) by adding at the end the following: (10) Grants (A) In general At the election of an eligible entity that receives a loan under this subsection, the Secretary shall provide to the eligible entity a grant to pay for a portion of the costs incurred in— (i) applying for the loan; (ii) making a loan to a qualified consumer under subsection (d); (iii) making repairs to the property of a qualified consumer that facilitate the energy efficiency measures for the property financed through a loan provided to the qualified consumer under subsection (d); (iv) entering into a contract under subsection (e)