President Donald Trump’s sweeping order to exclude undocumented immigrants “to the maximum extent feasible” from the 2020 census faced skepticism Monday from a majority on the U.S. Supreme Court, even as several key justices showed openness to affording Trump some discretion in a tally that could have a major political impact.

By subtracting millions of immigrants from the census total, Trump hopes to shape the apportionment of congressional seats, the allocation of billions in federal funds and the contours of the nation’s electoral map for at least the next decade. If he succeeds, it would be the first time in 230 years that the process would exclude large swaths of people inside the U.S.

“A lot of the historical evidence and longstanding practice really cuts against your position,” Justice Amy Coney Barrett told Trump acting Solicitor General Jeffrey Wall during oral arguments.