On September 9th, Volkswagen engineer James Liang pleaded guilty after being indicted on a variety of crimes related to VW’s deliberate use of a software routine that cheated on government diesel emissions testing.

Until his guilty plea was entered in United States District Court in Detroit, Liang’s indictment was under seal. Now that it has been made public (full PDF version here), we know more details about VW’s cheat and it turns out that the German automaker even updated the original software cheat — apparently to work more effectively — with a patch delivered in the guise of fixing emissions related warranty claims.

As the scandal was breaking, Volkswagen also deliberately supplied government agencies with false data to make the problem appear to be the result of a mechanical malfunction, not a defeat device.

Liang had worked at VW in Germany on diesel engine development from 1983 until 2008, when he transferred to the company’s American subsidiary to help launch vehicles using the EA 189 engine, taking a position as Leader of Diesel Compliance. It’s in that capacity that Liang signed off on false certifications for the U.S. Environmental Protection Agency and for the California Air Resources Board.

Those certifications are the basis of many of the criminal charges against Liang, though the criminal conspiracy goes back to when the team in Germany responsible for the then-new EA 189 realized they could not meet both VW’s performance objectives and pending U.S. diesel emissions standards, thus decided to cheat. An unidentified “Company A” is mentioned as a co-conspirator, having helped develop the defeat device with Liang’s team in Germany.

The cheat worked via a software routine that could tell when the EPA or CARB was testing one of Volkswagen’s diesel-powered cars. Modern automobiles have all sorts of sensors and it’s not too difficult, using those sensors, to figure out the standard testing conditions — especially ones that rarely happen in the real world, like the front wheels moving (on a chassis dyno) while the rear wheels remain stationary. When tested, the engines were clean, but they put out as much as 40 times the allowable limits of oxides of nitrogen when driven on the open road.

As the EA 189 engines aged, VW started experiencing increased warranty claims on the emissions control systems for those motors, apparently the result of emissions testing of consumers’ cars in emissions-strict states like California. VW announced to customers and the public in 2014 that they were going to update software in customers’ cars as a fix for those warranty claims. In fact, the software update was intended not to fix the cars but rather to update the software cheat so it would read steering wheel angle to more accurately detect when the car was being emissions tested.

It’s not entirely clear from the indictment, but it’s possible the update may have helped the defeat device work when the cars underwent annual state testing. It’s also possible the update to the cheat was intended to reduce warranty costs. One purpose of the software update, according to the indictment, was to “reduce the stress on the emissions control systems,” which I believe means reduce the amount of time the engine was running in compliant mode.

VW was working hard that year to keep the scandal from breaking, to no avail. Also in 2014, a study performed at West Virginia University for the International Council on Clean Transportation confirmed discrepancies between dynamometer testing of VW diesels versus real world, on-the-road results. Following the publication of the ICCT commissioned study, CARB, in conjunction with the EPA, started asking VW more detailed and specific questions, as well as performing their own testing. The indictment alleges that in response to those inquiries, VW made false and fraudulent statements to the EPA and CARB when providing data, test results and presentations, making it appear that the non-compliant emissions were due to innocent mechanical and technological problems. That deliberate obfuscation was also charged to be criminal.

The government further alleged that a 2015 voluntary recall announced by VW, supposedly to fix those mechanical problems, was knowingly fraudulent since it did not remove the defeat device.

Though it wasn’t identified, we know that Company A is not Bosch, an important supplier of diesel technology. The indictment describes Company A as “an automotive engineering company based in Berlin, Germany [specializing] in software, electronics, and technology support for vehicle manufacturers. ” VW AG is Customer A’s largest customer and the automaker owned 50 percent of Company A at the time of the conspiracy. Robert Bosch GMBH is 92-percent owned by a charitable foundation established by the company’s founder. The VW group owns effective controlling interests in a number of automotive companies, so I’m not going to speculate on who Company A is without more information.

Liang’s attorney says the his client is cooperating fully with government investigators. It’s a safe bet there are lawyers in Germany going over that country’s extradition treaties with the United States as you read this.