Former University of Iowa student Trevor Graves appeared in federal court Thursday to face charges that he repeatedly gained unauthorized access to his professor’s university accounts.

An FBI report alleges that Graves, 22, used that access to get advance copies of exams and change grades for himself and fellow students. He was arrested on October 24 in Denver and faces ten years in prison. Graves is said to have changed his grades more than 90 times from March 2015 to December 2016 and changed grades several times for at least five fellow students.

Here’s how he did it, allegedly: An FBI investigator writes in the complaint, obtained by Inverse, that Graves used a keylogging device — commercially available between $40 and $100 — on his professors’ computers to record their university logins. Once he had the passwords, he went to work changing grades.

Then, Graves and others used an elaborate system of secret codes in their text messages to disguise their grade-changing activities. And by “elaborate system,” we mean they used the word “pineapple” a lot.🍍

The FBI and the University of Iowa’s Department of Public Safety used the IP addresses for suspected illicit logins and the texts found on the students’ seized cellphones to piece together what they allege happened. The complaint itself reads like a cross between the tragic tale of a kingpin’s rise to power and the next great spy novel, albeit one that uses the word “pineapple” way more than the typical John le Carré effort.

Here’s one exchange between Graves and a fellow student the complaint identifies as A.B., from September 2015. (Emphasis ours.)

Graves: We do homework tonight and leave late tonight?

A.B.: Possibly. Did pineapple work?

Graves: I find out after VectorCalc….OK sound good

A.B. Ok sound good

Graves: If it works we leave early ish today?

Graves: Yes it work

A.B.: Is pineapple on there??

Graves: No but changing pineapple is available

A.B.: Okie doke. I pretty sure I can get test back

Graves: Sweet

And here’s another from later that same month:

A.B.: We gotta go hunting.

Graves: Hunting? I’ve never been

A.B.: Yes you have

Graves: Not for real, shooting things out my truck windows doesn’t count

A.B.: Pineapple hunting

Graves: Ah pineapple hunter is currently laying in wait in a classroom already

A.B.: We go hunting when you get it back?

Graves: Yup

A.B.: Ok sounds good

From October 2015:

A.B.: We should pineapple soon

Graves: wet should for sure

A.B.: You got new one?

Graves: I did

A.B.: It works?

Graves: Yup

And another from later that October:

Graves: I know how to change pineapples

A.B.: Lol I know

You can almost hear the deadpan tone when, at the end of compiling those and other text exchanges, the FBI investigator writes, “Based on my training and experience, and based upon the interview of student A.T., your affiant believes the term ‘pineapple’ was used as a code word for the ‘keylogging device.’”

Other text exchanges suggest Graves didn’t want his schoolmates to take his espionage efforts as an excuse to slack off on their studies:

Z.B.: Did you tell Brandon about the “hand of god” on that test

Graves: No

Graves: The less people know the better

Z.B.: Yea I complete agree

Graves: Just don’t want him getting comfy with his knowledge and not thinking he needs to study as much

Graves: Tell him to study more

Whether this was because Graves was looking out for his classmate’s academic enrichment or just didn’t want the altered grades to be too big and noticeable must be left to the reader’s interpretation.

Other details from the complaint depict Graves as either cautiously working out who he can trust… or just lording his knowledge over his fellow students. Consider this scene, in which another student identified as A.T. describes how Graves gradually let them in on his big secret:

At first, Graves gave A.T. subtle indications he knew what was going to be on exams. As an example, Graves would flip through the course textbook and point out a particular problem and tell A.T. to study that problem. The problems Graves would point out to A.T. would end up being on the exams. Graves then gave A.T. an advance copy of the final exam for Mechanics of Deformable Bodies.

Graves is the only individual facing charges, but the complaint is full of tales of fellow students compromising their most cherished ideals when faced with impossible temptation — again, like any great crime drama.

One student claims they stood outside a computer lab while Graves worked inside, but denies they were a lookout because Graves never explicitly asked them to be one. Another says they demanded Graves not change any more of their grades after finding out what he was up to, but they kept accepting advance copies of exams for fear other students with early access would wreck the grading curve.

The full, riveting complaint is available to read below. Graves is innocent until proven guilty, but if even a portion of this is true, make no mistake: This kid is a hero and a legend. A real pineapple, even.