A former Microsoft worker has been arrested and charged with mail fraud, in an alleged scheme to steal $10 million worth of digital currency from his ex-employer and use the funds to finance extravagant purchases, including a Tesla and lakefront home.

Volodymyr Kvashuk, a 25-year-old software developer and Ukrainian citizen who worked for Microsoft from 2016 to 2018, allegedly took advantage of a testing program meant to simulate customer purchases. He made test accounts to obtain Microsoft gift cards and then sold some or all of them through online resellers.

According to a release from the U.S. Attorney’s Office, Kvashuk allegedly used a “bitcoin mixing service” to try and mask the source of the funds he was moving into his bank account. He allegedly used the money to buy a $160,000 Tesla vehicle and a $1.6 million lakefront home.

Microsoft investigators were able to crack the case and confronted Kvashuk in May 2018, according to the release. He was fired a month later.

Kvashuk made his first appearance in court Tuesday and will be back in court Friday. Mail fraud carries punishments as high as 20 years in prison and a $250,000 fine.