Following the announcement that Apple CFO Peter Oppenheimer will be retiring in September, the Australian Financial Review has uncovered evidence of a scheme that it says has allowed Apple to move around $9 billion in untaxed Aussie profit to Ireland. The program has allowed Apple to get away with paying only $200 million in taxes on $8.9 billion in profit over the past ten years or so.

Here’s how the whole thing works: Apple has created an Ireland-based company known as Apple Sales International which contributes money toward the research and development budget in Cupertino. This allows the company to legally claim an economic stake in these products and gives ASI partial ownership of the intellectual properties that comprise Apple’s products.

Most of the profits for international sales of these products are then routed to Apple Sales International under the guise of intellectual property licenses. As noted above, this figure comes out to around $8.9 billion over the course of about a decade. This money is paid out bt Apple Australian before taxes, allowing the Australian branch of the company to report much lower profits (and thus pay much lower taxes) while ASI redistributes the money back into Cupertino’s budget.

It should be noted that nothing here is actually illegal according to Australian government officials. Shifting money overseas to avoid taxation isn’t an incredibly rare practice. Many large international companies use tricks and loopholes to minimize the impact of taxes. Despite that, the Australian government has said that it plans to attempt to recover the taxes that Apple and others have avoided.