The U.S. Presidential election is only days away and Donald Trump’s taxes are back in the news.

The New York Times reported last month that Trump reported a $916 million loss on his 1995 New York state tax return. That loss would have allowed him to avoid a tax liability for up to 18 years. However, the real question was how did Trump generate such a large loss to begin with?

The Times reported one likely scenario, after reviewing Trump’s bankruptcy and casino filings from the 1990s, where the real state executive may have used a questionable tax strategy involving exchanging defaulted debt for an ownership stake in his casino businesses. This exchange allowed Trump to avoid recognizing income from the cancellation of the debt, while still allowing deductibility of the underlying losses. While plausible, it is by no means the only possible explanation.

Therefore, the legitimacy of Trump’s tax strategy is inherently a moral question. Rules and regulations over federal taxes are incredibly complex and often ambiguous. This is one reason that taxpayers spend more than $160 billion and more than six billion hours on tax compliance. Given this ambiguity, tax laws are frequently open to various interpretations, pro-taxpayer or pro-government. A taxpayer is not obligated to resolve all doubt in favor of the IRS.

Since Trump has declined to release his tax returns for the years in question, his actual tax strategy will remain a mystery. If Trump did utilize a debt-for-equity swap to avoid income recognition, did this strategy amount to Trump not paying his fair share of taxes? Based on the law and facts at the time, not necessarily. Trump was merely using a very aggressive and innovative interpretation of the law.

Trump is involved in real estate development. This included the construction of casinos in Atlantic City, as well as real estate in New York. Real estate development is often carried out through the use of pass-through entities, such as partnerships and S corporations, firms taxed similar to partnerships. This arrangement allows profits and losses to flow through to Trump’s personal tax returns — typical for real estate development. The use of partnerships and S corporation to pass-through losses goes back decades and one of the reasons for their very existence.

Going back to the debt for equity swap that Trump may have used, this technique, while aggressive, was not unique to Trump. These same strategies were utilized by a cross-section of large real estate developers at the time. While the size of the transaction stands out, the strategy itself does not. Real estate development, like any industry, is competitive. This competition forces business owners to be aggressive and to think outside the box. The aforementioned tax strategy was an innovative solution. Reducing one’s tax liability conserves cash that may be reinvested in the business, or used to explore additional development opportunities.

There have been allegations that Trump’s strategy, again if used, was somehow improper. It is not illegal to take an aggressive position on your tax return, as long as the position is not frivolous or fraudulent. There’s also nothing inherently wrong in using every tax break possible. As for the strategy itself, there is no assertion that it was illegal or otherwise a violation of the tax code.

Trump even sought out a tax opinion letter from what I and others consider a well-respected New York law firm, Wilkie Farr & Gallagher. While the firm did conclude that the strategy was risky and likely would be opposed by the government, it also acknowledged that there was substantial authority for the position. The phrase “substantial authority” indicates only a one out of three chance of success if challenged, but it also indicates that the position is not frivolous, and it is sufficient to avoid imposition of penalties.

The Tax Section of the American Bar Association even expressed its belief in the validity of this strategy in 1992. However, the strongest support for the validity of Trump’s tax strategy was the Supreme Court’s 8 to 1 decision in 2001 allowing another taxpayer to utilize a similar strategy. While Congress did amend the law the following year to prevent application of this strategy going forward, it was legal at the time Trump allegedly used it.

And Trump’s equity-for-debt strategy exploited a known ambiguity in the law, one that the Supreme Court later recognized. This ambiguity was removed in 2002, but it still existed in the 1990s. Trump, through his tax advisors, did what any taxpayer would do, he structured his affairs to minimize his tax liability.

Stephen C. Gara is an associate professor of accounting at Drake University in Des Moines, Iowa.