Screenwriter Graham Moore drew inspiration for “The Imitation Game” from Andrew Hodges’s biography “Alan Turing: The Enigma” and kept the basic outline of the true story: Turing was a brilliant mathematician recruited during World War II to work at England’s code-breaking hub, Bletchley Park, where he led a team that translated messages encrypted by Germany’s Enigma machine. He was also gay, and homosexuality was illegal at that time in England. So, despite his incredible feats during the war, he was later convicted of indecency and given the choice between jail and chemical castration. He chose the latter.

Moore takes some liberties with history in order to make a more emotionally-charged story. “The Imitation Game” paints Turing as an awkward loner, who either irritates or enrages the people around him. Idiosyncratic as he may have been, Turing was actually well-liked at Bletchley Park, according to Hodges’s book. And while Turing contributed tremendously to the war effort, he didn’t single-handedly build a machine from scratch in order to do it — he made significant improvements to the Bombe, a machine that was created years earlier by Polish mathematicians.

Fact-checking the Best Picture nominees:

Perhaps the riskiest departure from the truth was inserting a villain into the story in the guise of Cmdr. Alastair Denniston, played in the movie by Charles Dance. Denniston is painted as Turing’s malevolent nemesis, hell-bent on getting the mathematician fired, when in fact the commander was supportive of the code-breakers and their efforts. Moore would have been better off inventing an adversary from whole cloth; Denniston’s grandchildren have voiced their frustration with what they see as an unnecessary slight.