Decades-old precedent that lets online retailers ignore state sales tax requirements appeared to divide the Supreme Court on Tuesday.

While this morning’s arguments involve discount decor giant Wayfair, the case sprouted from a law that South Dakota crafted in response to Quill Corp. v. North Dakota, which the Supreme Court decided in 1992.

The ruling says that the so-called dormant commerce clause bars states from regulating businesses that do not have a physical presence within their borders.

Most states charge sales tax to customers, and businesses gather the money to send to the state by collecting the tax as part of each transaction.

Online retailers have no such obligation under federal law, however, pushing the tax-payment requirement to the customers.

While Amazon and some other large online retailers now collect sales tax voluntarily, South Dakota passed a law that targets out-of-state companies that bring in at least $100,000 in sales or make 200 transactions with customers in South Dakota. The law requiring them to withhold sales tax from each purchase and send it to the state.

Defending the law this morning before the high court, South Dakota Attorney General Marty Jackley said that an overwhelming majority of customers never pay their sales taxes, either because they don’t know they have to, or because they know the state won’t hassle them about it.

This leaves small business with traditional storefronts at a competitive disadvantage with the online retailers that are increasingly becoming more dominant forces in  the market, Jackley argued.

“Small businesses are not being treated fairly,” Jackley told the justices. “We’re not asking remote sellers to do anything that we’re not already asking our small businesses to do in our state. And that is simply to collect and remit a tax.”

Justice Sonia Sotomayor expressed concern Tuesday that overturning Quill could throw the online marketplace into chaos as retailers scramble to figure out how to comply with a complicated web of sales tax rules.

“I’m not concerned with your scheme as such,” she told the South Dakota attorney general. “I’m concerned about the many unanswered questions that overturning precedents will create a massive amount of lawsuits about.”

Justice Elena Kagan wondered meanwhile whether the court should leave in place its precedent until et Congress weighs in.

“In other words, from this court’s perspective, the choice is just binary, it’s you either have the Quill rule or you don’t,” Kagan said. “But Congress is capable of crafting compromises and trying to figure out how to balance the wide range of interests involved here.”

South Dakota’s Jackley informed the justices, however, that lawmakers in Washington have been promising to legislate in this area for a quarter-century.

“It’s not Congress, but it’s Quill, it’s this court’s decision that is striking down our state statutes,” Jackley said.

Justice Anthony Kennedy, who invited the current challenge in a 2015 concurrence, stayed mostly silent during Tuesday’s oral arguments. He jumped in near the end, however, to press an attorney for several online retailers on why the court should leave Congress to write laws that rest on flawed precedent.

“You say that congressional action should be taken against the background in which this court has made a statement of constitutional law that has now, especially in light of the cyber age, proven incorrect,” Kennedy said. “So you want Congress to act against this background in which this court has made an incorrect resolution of the law. That’s the assumption you’re making.”

Sotomayor and Justice John Roberts meanwhile questioned the limits of Jackley’s position, wondering if any business would be small enough to be relieved of the burden of complying with a law like South Dakota’s. Jackley said even a single sale into a state by an out-of-state retailer could be enough if other states wanted to craft their laws that way.

Deputy Solicitor General Malcolm Stewart, arguing for the federal government as a friend of the court in support of South Dakota, agreed with Jackley’s assessment, but reminded the justices Congress would have room to exempt smaller retailers even if the court ruled in the state’s favor.

But George Isaacson, an attorney for the retailers, said this would make it impossible for businesses to figure out their tax responsibilities as they would be forceed to navigate a tangle of competing state rules. He said software can help the process, but a perfect system remains elusive.

Isaacson also argued overturning a precedent upon which online retailers have made countless business decisions would cause chaos in the marketplace, even if Congress eventually stepped in to stabilize things.

“The notion of a chaotic period preceding Congress coming in to address the issues is as daunting as any in terms of what the consequence of overruling Quill would be,” said Isaacson, who is with the firm Brann & Isaacson in Lewiston, Maine.

Still, Justice Neil Gorsuch struggled to see why the court should endorse a scheme that treats traditional businesses differently than online retailers.

“Why should this court favor a particular business model that relies not on brick and mortar, but on mail order?” Gorsuch asked.