A former Siemens third party contractor is facing 10 years in prison, a fine of $250,000, or both after pleading guilty to planting logic bombs inside spreadsheets he created for the company.

According to court documents, David Tinley, 62, provided software services for Siemens’ Monroeville, PA offices for nearly ten years. Among the work he was asked to perform was the creation of spreadsheets that the company was using to manage equipment orders.

The spreadshees included custom scripts that would update the content of the file based on current orders stored in other, remote documents, allowing the company to automate inventory and order management.

But while Tinley’s files worked for years, they started malfunctioning around 2014. According to court documents, Tinley planted so-called “logic bombs” that would trigger after a certain date, and crash the files.

Every time the scripts would crash, Siemens would call Tinley, who’d fix the files for a fee. The scheme lasted for two years, until May 2016, when Tinley’s trickery was unraveled by Siemens employees.