President Donald Trump is dropping his quixotic effort to ask Americans about their immigration status during next year’s census, but his administration’s efforts to identify illegal immigrants will continue.

In place of the census question, Trump says he will issue an executive order instructing government agencies to sift through existing databases and documents to determine residents’ immigration status. “We will leave no stone unturned,” Trump said during a press conference in the White House’s rose garden on Thursday evening. “I am here to say we are not backing down on our effort to determine the citizenship status of the United States population.”

But the administration is backing down from an 18-months-long legal battle to include that question on census forms—a fight that even many conservatives have suggested was an error from the outset. The Supreme Court ruled last month that the justification for adding the citizenship question to the census—Trump administration lawyers claimed it was needed to obtain data so the Voting Rights Act could be appropriately enforced—was “contrived” and “pretextual.”

That kicked off a chaotic two weeks. Justice Department lawyers agreed on July 2nd to drop the matter. Trump tweeted on July 3rd that he told the Justice Department to keep fighting. A judge hauled those lawyers into a bizarre conference call where it was suggested they could not accurately represent their client, the president (the lawyers claimed they did not know Trump was going to contradict them via tweet, which is probably accurate). Those same lawyers were substituted for others who backed the president. The substitution was blocked by a different judge. Trump fumed on Twitter. Trump said he would issue an executive order putting the citizenship question on the census anyway. And, finally, Trump stood outside the White House admitting defeat.

What does it all mean? Perhaps most importantly, it means the census will be more accurate than it likely would have been if the citizenship question was included. One does not need to play 17-dimensional chess to realize that many illegal immigrants would be unlikely to answer the decennial survey honestly—or, for that matter, at all—if that meant giving their home address and other personal information to a hostile administration. An inaccurate census would have numerous unintended consequences, from altering how congressional seats are apportioned to determining how federal funds are allocated.

It’s also another indication of how Trump’s rhetoric and his administration’s bumbling of basic policy has undermined the president’s goals. As Reason‘s Jacob Sullum has explained on several occasions, Commerce Secretary Wilbur Ross is largely to blame for Chief Justice John Roberts’ decision to sink the citizenship question by siding with the Supreme Court’s four liberal justices. And Ross was tasked with creating a legal rationale for the citizenship question because a Republican gerrymandering expert thought deliberately undercounting immigrant households would help the GOP win future elections. Not that the administration could say that in court, of course.

The president will follow the rule of law and allow the census to happen without a citizenship question. That’s good news. It’s also good news to see, yet again, the institutional checks and balances of government prevent Trump from carrying out a plot to turn the census into a political event.

And all it took was a year-and-a-half-long circus.

“Count it as a win for reality,” said Michael Waldman, president of the Brennan Center for Justice, a nonpartisan group that had opposed the inclusion of the citizenship question on the census. “The Trump administration should focus on its real job: ensuring a full, fair, and accurate count of everyone in the nation.”