; and (ii) in the case of an organization, retain employees of the organization who are providing a public service for the unit in which the organization is located and who would otherwise be laid off as a consequence of budget cuts. (B) Exception In a case in which 50 percent of a grant amount received under this section would exceed the amount needed for a unit or organization to retain the employees described in subparagraph (A), the unit or organization may use only the amount needed to retain such employees for such purpose. (2) Authorized uses After using grant funds received under this section in accordance with paragraph (1), a unit of general local government or community-based organization may use any remaining grant funds provided under this section to— (A) in the case of a unit of general local government— (i) employ individuals in new positions providing a public service for the unit; or (ii) train individuals for new public service positions for the unit; and (B) in the case of a community-based organization— (i) employ individuals in new positions that would provide a public service for the unit in which the organization is located or services in the private sector; or (ii) train individuals for any such positions. (d) Priority for certain individuals The Secretary shall encourage each unit of general local government and each community-based organization receiving a grant under this section to use such grant funds to retain, employ, or train— (1) veterans; (2) individuals with disabilities; (3) individuals who are receiving unemployment benefits