President Trump may be about to declare a national emergency to pay for his border wall that Mexico isn’t paying for.

The legality of such a move is questionable: The National Emergencies Act of 1976 allows the president to declare national emergencies and another law, the Military Construction Codification Act of 1982 allows the president to do that and direct military construction projects that Congress did not otherwise approve—as long as the money comes out of the military construction budget. But, building a wall on the southern border might not be an entirely legitimate use of the armed forces, which are forbidden by law from participating in law enforcement functions inside the United States.

Even so, let’s say President Trump really could divert $5.7 billion from the military construction budget toward his wall. Where would that money come from?