A contract programmer has pleaded guilty to planting “logic bombs” inside a client’s spreadsheets in an attempt to receive extra work from the company every time the software crashed.

David Tinley — the Pennsylvania-based 62-year-old contract programmer in question — now faces a fine of up to $250,000, up to 10 years in prison, or both.

According to court documents, Tinley offered software services to Siemens‘ Monroeville, PA office for about 10 years. He had been hired to create custom, automated spreadsheets that were used by the firm to manage orders for electrical equipment.

Tinley planted logic bombs in these spreadsheets that were set to go off every couple of years, the court documents revealed. Logic bombs are secret instructions inserted into a program that are meant to be carried out when a certain condition is met, usually with malicious effects.

In this case, the logic bombs crashed the spreadsheets repeatedly, requiring the German tech conglomerate to call Tinley over and over again to fix it. He would resolve it by postponing the date the spreadsheets would glitch again.

Tinley’s scheme eventually fell apart after two years in May 2016. According to a report from Law360, the logic bomb was revealed after he was forced to share the spreadsheet’s administrator password with Siemens‘ IT staff when he was out of town so that they could fix the buggy software.

His lawyers said that his motivation was merely to protect his proprietary program and not to make any extra money from Siemens. Prosecutors, however, argued that the act should be considered a felony, as the company had to spend about $42,000 on an investigation to determine the extent of damage caused due to the malicious code.

Tinley was charged this May, and pled guilty last week, on July 19. The contractor’s sentencing hearing is scheduled for November 8.

Read next: Russians caught peddling spyware disguised as legit Google and Pornhub apps