The Imitation Game portrays the complex genius who helped win World War II

English actor Benedict Cumberbatch continues to carve a niche playing characters who are brilliant but unable to navigate everyday human interaction—some real (WikiLeaks founder Julian Assange in 2013’s The Fifth Estate) and others fictional (the 21st century Sherlock Holmes in the recurring PBS mini-series). This is a risky career path, and the fact that Cumberbatch pulls it off so well is a testament to his skill.

In The Imitation Game, Cumberbatch portrays Alan Turing, inventor of the computer (known in the 1950s as a “Turing machine”) and leader of a British team that deciphered Enigma, the supposedly unbreakable code used by the Nazis to send messages during World War II. The success of Turing’s team of expert cryptographers, who used the crude prototype computing machine he developed for this purpose, was a major factor in the Allies’ victory.

Directed by Morten Tyldum (Fallen Angels, Headhunters), the movie flashes back to Turing’s boarding school days, exploring how his interest in cryptography developed, linking it to his deep unpopularity and his growing love for the only boy who offers friendship rather than cruelty. It becomes clear that for Turing, commonplace communication among people is a foreign language that he must decode. After his only friend, Christopher, dies of tuberculosis, Turing’s love for him becomes a secret which, the movie speculates, drives Turing for the rest of his life, even leading him to name his computer after his lost love.

The Imitation Game deftly illuminates how Turing thinks via several scenes that depict his social incomprehension—scenes that are humorous without making fun of him. Among them is a marvelous exposition of flirting by a member of the team, Hugh Alexander, played with both ironic distance and passion by Matthew Goode (Leap Year and TV’s The Good Wife).

With a Golden Globe-nominated screenplay by Graham Moore (based on Andrew Hodges’ biography of Turing), the movie goes beyond the cliché of the misunderstood genius. While that was clearly Turing’s situation, Imitation also reveals how his abrasiveness turns off most people, including other members of his team and their military commander, played by Charles Dance. We see that Turing felt things deeply, as the film explores his relationship with Joan Clarke (Keira Knightley), the only female member of the Enigma-cracking team. Turing was briefly engaged to her before breaking it off when he realized he couldn’t live as a straight man.

The film’s pacing is a bit disconcerting at first, as it skips from the Enigma code-breaking story back to Turing’s school days and forward to the 1950s, when he was prosecuted for his homosexual liaisons—illegal in Britain at that time. Otherwise, The Imitation Game is an engaging movie that makes a biopic feel like a thriller.