The Donald J. Trump Foundation was an audacious grift, even by the standards of its namesake. Charitable foundations are supposed to operate under a simple premise: They receive certain tax exemptions when it comes to receiving and disbursing their funds, and in turn, those funds will be funneled into good works for society’s benefit. For Trump’s charity, however, those good works largely amounted to crass self-enrichment—a guiding principle throughout the president’s life and political career.

The Washington Post’s David Fahrenthold reported two years ago that the Trump Foundation’s most generous expenditure, totaling $264,361, went to renovations for a fountain outside the Trump-owned Plaza Hotel in New York City. Its smallest contribution—just $7—appears to have been used to pay for Donald Trump Jr.’s registration fee for the Boy Scouts of America. In one instance, Trump auctioned off a six-foot-tall painting of himself to charity, then spent $20,000 from the foundation’s funds to purchase it.

New York thinks it can find a better use for the money. Barbara Underwood, the state’s attorney general, announced on Tuesday that the president agreed to shut down the foundation and let state officials disperse its remaining funds to genuine charitable organizations. “This is an important victory for the rule of law, making clear that there is one set of rules for everyone,” Underwood said in a statement announcing the agreement. Her office is still pursuing more than $2 million in restitution from Trump and restrictions on his family’s involvement in non-profit organizations in the state.

An investigation by Underwood’s office uncovered a clear pattern of instances where the Trump family misused charity funds. The foundation cut checks for well-publicized donations during Trump’s presidential campaign, transmogrifying charitable funds into politically beneficial expenditures. It shelled out hundreds of thousands of dollars to settle legal disputes involving Trump himself or his companies. Normal safeguards like an active board of directors, standard accounting practices, and grant-making policies did not exist. The charity itself, investigators said, “is little more than an empty shell.”

“In sum, the Investigation revealed that the Foundation was little more than a checkbook for payments to not-for-profits from Mr. Trump or the Trump Organization,” the attorney general’s office said in a lawsuit this summer. “This resulted in multiple violations of state and federal law because payments were made using Foundation money regardless of the purpose of the payment. Mr. Trump used charitable assets to pay off the legal obligations of entities he controlled, to promote Trump hotels, to purchase personal items, and to support his presidential election campaign.”