In a peculiar turn of events, secularist organization Freedom From Religion Foundation (FFRF) has argued before a federal appeals court that an atheist has the right to pray on the floor of the U.S. House of Representatives.

Dan Barker, co-founder of FFRF, desired to serve as Rep. Mark Pocan’s (D-Wis.) guest in leading the opening prayer for the following legislative session. Barker is an atheist. His request was denied because it was determined that he did not meet the chaplain-policy requirements to give an invocation on the House floor. His lawsuit argues that the policy unconstitutionally discriminates against nonbelievers under the Establishment Clause of the United States Constitution.

It is ironic and hypocritical that the group that routinely seeks to box out religion from the public square is now invoking the principles of religious freedom in order to make a secular invocation in our national legislature.

This anomaly notwithstanding, the greater issue is that the current judicial precedent surrounding the Establishment Clause is so malleable (one federal circuit court judge called it “a hot mess” and “a wreck”) that even something as unobtrusive as prayer is no longer guaranteed protection in the public square. Coach Joe Kennedy of Washington is one example, and there are many more like him across the nation.

As the late Justice Antonin Scalia observed, 1970s-era Establishment Clause doctrine has created a “geometry of crooked lines and wavering shapes” in this area of constitutional law. So what should we expect out of the judges responsible for interpreting constitutional law at our nation’s highest court and in lower courts across the country?

To establish sound Establishment Clause (or any constitutional) doctrine, the most intellectually honest and sustainable approach is to look to the understanding of the Founders at the time they penned and ratified the U.S. Constitution. This means looking at history. As the U.S. Supreme Court once said, “The line we must draw between the permissible and the impermissible is one which accords with history and faithfully reflects the understanding of the Founding Fathers.” This idea of looking at the understanding of the drafters of any law is as true for the latest entry of the U.S. Code as it is for the First Amendment.

Barker’s case involves legislative prayer, which is specially recognized for its undeniable historical precedent. In fact, legislative prayer, or “divine service,” has taken place as early as the 1700s. Largely because of its deep roots in history, legislative prayer is considered constitutional. It is an instructive example of how the courts have used and should use legal history to determine the constitutionality of religion in the public square. Unfortunately, the same is not true for judicial precedent surrounding religiously inspired monuments or certain tax exemptions, which some argue should fail constitutional muster under the Establishment Clause.

Fortunately, scholars have observed a resurgence in the role of legal history in modern judicial decision-making at the Supreme Court. What’s more, President Donald Trump’s laser-like focus on the appointment of judges has resulted in “appointees [that] are showing themselves to be strong spokespeople for what is generally described as the conservative viewpoint.” As such, law professor Arthur Hellman of the University of Pittsburgh said, “[n]ew blood reopens old issues.” And even though this use of legal history, or “originalism,” has become associated with “the conservative viewpoint,” the fact is that it is “ideologically neutral. On various stormy issues, both the conservative and liberal factions . . . have found safe harbor in historical reasoning.” What all this means is stable judicial precedent—not the confusion that exists today.

As with the doctrine of legislative prayer, we need to return to our legal historical roots and use what we find there as our guiding principles for understanding the constitutionality of religion in the public square.

Moreover, with mid-term elections on the horizon, it is critical that we vote in U.S. Senators who will help appoint judges that protect our constitutional rights. Our Republican-controlled Senate has faithfully stewarded its advice-and-consent powers by helping appoint judges who value historical reasoning. We ought to vote for candidates who will continue this trend.

Public prayer in schools and the government workplace, for instance, is more constitutional than it’s given credit for. You can feel assured in this by looking no further than Article III of the Northwest Territory Ordinance of 1787, in which the Founding-era Congress stated, “Religion, morality, and knowledge, being necessary to good government and the happiness of mankind, schools and the means of education shall forever be encouraged.”

As for Barker and his legislative prayer case—we’ll have to see whether the judges in his case conclude that history is on his side.