He was Britain’s greatest mathematician of the mid-20th century and a pioneer in the field of computer science.  With his colleagues at Bletchley Park, the wartime station of the British Government Code and Cypher School, he deciphered Germany’s famous “Enigma” military code and possibly saved millions of lives.

In 1946, he was appointed an Officer of the British Empire (OBE) for his secret work at Bletchley Park. Then they hounded him to death . . . because he was gay.

This essential information about Alan Turing does not become fully evident until the credits start to roll in The Imitation Game, the 2014 movie starring Benedict Cumberbatch as a closeted Turing attempting to crack the “Enigma” machine. But a retrospect viewing of the film, informed by all we’ve learned about the persecution suffered over the years by gay, lesbian, and transgender people, lends this movie particular resonance at this time—especially as Turing’s pioneering work on artificial intelligence is finally gaining the recognition it deserves.

Keira Knightley, Matthew Beard, Matthew Goode, Benedict Cumberbatch, and Allen Leech in The Imitation Game, via Time

The movie tells the story of Turning’s life almost entirely in flashbacks, from the vantage point of 1952, when he was arrested for his homosexual activities. It depicts his adolescence, his work at Bletchley Park, his arrest and conviction for “gross indecency” (or sexual activity between two men, which was illegal then in Britain), and his suicide in 1954.

Although based on the actual events in the life of Alan Turing and draws extensively on Alan Turing: The Enigma, the definitive 1983 biography by Andrew Hodges, the film takes many liberties with historical accuracy for dramatic effect. Thus, the film depicts Turing as less active and less open about his homosexuality than he actually was, suggesting that he was ashamed or duplicitous about his sexual identity.

In fact, as Hodges shows, Turing frequently made advances to other men (although largely without success) and told his friends and colleagues about his homosexuality. Most importantly, when Turing proposed marriage in 1941 to his Bletchley Park colleague Joan Clarke (played by Keira Knightley in the movie), and she accepted, he told her about his sexuality.

He later ended their engagement, but they remained friends until his death. And when the police interviewed Turing in 1952 about evidence of his homosexual activities, he made no attempt to deny them and eventually pled guilty to the charge of “gross indecency.”

Alan Turing as a boy, via The Independent

Furthermore, Turing’s suicide is often blamed on the traumatic effects of the “chemical castration” “treatment” he endured following his conviction for “gross indecency” in 1952, and the movie suggests this was the case. Under pressure from the police, Turing had agreed to the “treatment”– involving administration of Diethylstilbestrol (DES), a form of artificial estrogen no longer used today—as an alternative to serving a lengthy jail sentence.

But it is less clear that it was the effects of the DES on his body than the relentless hounding by British authorities that fueled his depression. Turing was deeply devoted to his research, and the police harassment was making it increasingly difficult for him to concentrate on his work and engage in government-funded projects.

Indeed, it seems much more likely that Turing decided to kill himself in 1954—some 14 months after the end of his “treatment”—because he believed that he would never again be allowed to engage in government-sponsored research and might not even be allowed to continue teaching.

And he was almost certainly right. It was not until 2009 that Prime Minister Gordon Brown, under growing public pressure, released a public statement apologizing for Turing’s prosecution in 1952 for “gross indecency.”

“Thousands of people have come together to demand justice for Alan Turing and recognition of the appalling way he was treated,” Brown declared on September 10, 2009. “While Turing was dealt with under the law of the time and we can’t put the clock back, his treatment was of course utterly unfair and I am pleased to have the chance to say how deeply sorry I and we all are for what happened to him… So on behalf of the British government, and all those who live freely thanks to Alan’s work I am very proud to say: we’re sorry, you deserved so much better.”

As suggested by Brown’s remarks—his apologies on behalf of “all those who live freely thanks to Alan’s work”— Turing is probably best known in the public realm for his work in breaking the Enigma cipher and saving lives during World War II. More recently, however, he has come to be viewed by mathematicians and computer scientists as the progenitor of artificial intelligence computing, now the basis (for better or worse) of so much that governs our world.

Turing building the Enigma code breaker machine, via the Harvard Gazette

In 1966, the Association for Computing Machinery (ACM) created the A.M. Turing Award for contributions of lasting and major technical importance to computer science. The award is generally recognized as the highest distinction in computer science and is often referred to as the “Nobel Prize of Computing.” Since 2014, the award has been accompanied by a $1 million prize, with financial support provided by Google.

The Imitation Game depicts Turing as a “gay martyr,” like Oscar Wilde and the Irish rebel leader Roger Casement, who are also often portrayed simply as heroic gay men destroyed by the British government. As is often the case, history is more complicated and more interesting than fiction.

I prefer to see Turing as one of the many LGBTQ folks who attempted, against heavy odds, to live a fulfilling personal and professional life. Seen from this perspective, Alan Turing’s life at Bletchley—and the movie itself—deserve a fresh assessment.