The Shakespeare Code (TV story)

The Shakespeare Code was the second episode of the third series of Doctor Who. It saw the first televised appearance of William Shakespeare since a cameo in TV: The Chase in 1965. This was one of the most costly stories ever produced, with large expenditures on costumes and sets. This marks the second time in the revived series that the Doctor has met one of his favourite authors.

Gareth Roberts was well known as a fan of Shakespeare; he had included him as a character in A Groatsworth of Wit, a Ninth Doctor comic strip. This meant he had some background knowledge of the two plays Shakespeare was alleged to have written which form the basis of this story's plot. The Carrionites were also derived from the Bard's work, specifically the witches in Macbeth. Further knowledge can be seen in the many references to Shakespeare's works, notably Sycorax from.

Synopsis
The Doctor brings Martha back in time to England, 1599 for her trip in the TARDIS. After viewing a performance of Shakespeare's latest play, it would seem things are quite amiss in town. The lost play is to be performed soon, but what could have made the script itself vanish afterwards? And who is the mysterious girl keeping an eye on the genius writer?

Plot
London, 1599. A nymph is serenaded from her balcony by a lute-playing swain, Wiggins. She bids him enter, much to his delight. However, upon entering her home, he is shocked to find it full of horrifying witching artefacts, not what he would expect a beautiful girl to have in her home. The woman, Lilith, kisses Wiggins, but on pulling away he finds her transformed into a wrinkled hag. She decides to introduce her suitor to her two "mothers", Mother Doomfinger and Mother Bloodtide. Much to Wiggins' horror, the two mothers cackle and pounce on him, apparently devouring him. Lilith cackles that at the hour of spoken words, they will be freed and the Earth will perish.

Meanwhile, the TARDIS has just landed nearby. Martha steps outside and is amazed by the fact they've gone back in time. Questioning when they are in time, Martha is pulled back by the Doctor as the contents of a chamber pot are dumped from a window above them. The Doctor tells her it's "before the invention of the toilet", apologising. However, Martha takes the event in stride as she has seen worse things at the hospital. She then questions whether it is safe to walk around in the past, citing familiar time travel paradoxes such as the Grandfather paradox and the butterfly effect and worries about her reception as a black woman in a time when slavery still exists. The Doctor points out that he's not even human and to walk around like "you own the place", just as he does.

They walk around the town and the Doctor says Elizabethan England is far more tolerant and like the 21st century than she might think. He points out there are things similar to the future: recycling, 'water-cooler moments' and global warming - a man shouting that Earth will be consumed in flames. Figuring out the exact year they're in, the Doctor deduces their location is near the Globe Theatre. The Doctor tells Martha when she gets home, she can tell everyone she's seen Shakespeare. However, Martha gleefully and sarcastically retorts that she would get committed. At the end of the play Love's Labour's Lost, Martha tells the Doctor how much she loved the play before pointing out male actors are dressed as women. The Doctor jokes, "London never changes". Wanting to see the author himself, Martha starts what the Doctor thinks might be the first crowd chant for Shakespeare. The author himself comes on stage with the crowd cheering; he's quite a bit different from his portraits. The Doctor goes on about how much he admires Shakespeare's genius. However, the Doctor turns out to be wrong about the consistency of the Bard's genius when he asks the audience to shut their "big fat mouths". Martha tells the Doctor he shouldn't meet his heroes.

Shakespeare then announces there will soon be a sequel, Love's Labour's Won. Lilith, using a poppet, influences the great writer to rashly promise that the yet unfinished play will premiere the following evening. Martha asks why she has never heard of Love's Labour's Won. The Doctor knows of the lost play as it appears in the listing of Shakespeare's works, but the play itself is non-existent. Martha asks the Doctor if he has a "mini disc" to get the play recorded and sold for a mint-worth of money in the future. However, Martha catches herself saying this and asks the Doctor if it's actually a bad idea; it is. He decides to find out more about why it was never published — and extends Martha's "one trip".

At the Elephant, the inn where William Shakespeare is staying, the writer is discussing the announcement of his play with the actors, who are curious as to why he announced the play for tomorrow instead of next week as they planned. He will have the last scene finished by the morning. The Doctor enters and Shakespeare tells him to leave. He says he won't give him an autograph or a portrait done with him. He adds that the Doctor not ask him where he gets his ideas. Upon seeing Martha enter, he stop dead. Recognising the signs, the actors excuse themselves; William has found a new muse. Shakespeare is confused by Martha's clothing and the Doctor explains she's from "Freedonia". Upon trying to pass himself off as "Sir Doctor of TARDIS" via the psychic paper, the Doctor is shocked to find that Shakespeare sees it as blank - "That decides it, absolute genius". Martha is confused by this as she sees the Doctor's title on the paper. Shakespeare remains adamant about what he sees and the Doctor explains the psychic paper. The writer takes interest in the word and wonders who the Doctor is. However, his attention shifts to Martha, who he tries wooing, describing her as "a queen of Africa" or a "Blackamoor lady", which she finds slightly offensive. The Doctor says it's "political correctness gone mad".

At that moment, Lynley, Master of the Revels, demands to see the script before he allows the play to proceed. When Shakespeare offers to show him the finished script in the morning, the official leaves proclaiming that this slight means he will ensure the play will never be performed; the Doctor assumes that this explains why Love's Labour's Won was never shown. Lilith, who works at the inn, overhears this and secretly takes some of Lynley's hair which she adds to a doll. She contacts her mothers, who chant with her, using the doll to control Lynley. Lilith plunges it into a bucket of water. The Doctor, Martha and Shakespeare hear a commotion in the street and run out, where Lynley vomits water. Lilith stabs the doll in the chest, and Lynley collapses, dead.

Martha and the Doctor try helping him, but are shocked to find his lungs full of water. The Doctor calmly announces to the crowd that Lynley died a natural death, of an sudden imbalance of the humours. Confused, Martha asks the Doctor why he told the crowd a lie. The Doctor whispers that they've got "one foot in the Dark Ages", and any seemingly unnatural answer would lead them to think that it was witchcraft. When Martha asks what did kill Lynley, the Doctor responds, "Witchcraft", confusing her further.

Inside, they wonder about Lynley, but Shakespeare is equally confused by Martha's training as a doctor, wondering what kind of land Freedonia is. Martha defends herself by saying in Freedonia, women can have any profession they want. He then asks the Doctor how he can have eyes so old for someone young. The Doctor says it because he reads a lot. Shakespeare sees it's a trite reply, something he'd do himself. He then notes Martha looks at the Doctor like she's surprised he even exists.

The Doctor and Martha have been informed by the landlady (also the Bard's lover) that she's prepared a room for them. Shakespeare explains he still has to finish writing the end of the play and bids the Doctor good-night, saying he will solve why the constant performance from him tomorrow. The Doctor then gives Shakespeare his "All the world's a stage" line before retiring for the night. Martha is less than impressed with the room, complaining she doesn't even have a toothbrush. The Doctor gives her one from one of his pockets, explaining it contains Venusian spearmint. Martha begins to wonder if magic exists as well before the Doctor of course it doesn't - this looks like magic but is not. She complains that she just started believing in time travel and he should give her a break. The Doctor gives a disgruntled Martha mixed signals by casually sharing the bed with her only to show no interest, then dismissing the idea that a mere human could be channeling the psychic energy and bemoaning the lack of Rose's insight. However, without seeming to notice Martha's reaction, he attributes this to Martha being a novice to time travel. He says he'll take her back home tomorrow.

Meanwhile, Lilith entrances Shakespeare and, using a marionette, compels him to write a strange concluding paragraph to Love's Labour's Won. She is discovered by the landlady, whom she frightens to death with her true form. Upon hearing another scream, the Doctor and Martha run in to find her body as Shakespeare wakes. Through the window, Martha sees Lilith fly away on a broomstick. When asked by the Doctor what she saw, Martha answers, "a witch".

In the morning the Doctor, Martha and Shakespeare are confused by what has happened. Correctly guessing that Shakespeare is central to the witch's plot, Martha accidentally tells Shakespeare he will write about witches. Shakespeare then remembers Peter Streete spoke of witches; he was the architect for the Globe Theatre. This leads the Doctor to investigate the Globe next. There, he wonders why the theatre is tetradecagal. The Doctor thinks he's heard of something before that involves the number 14, but can't seem to remember it. Upon his companions' opinions of what has the number 14 in it, the Doctor asks why the Globe was designed like this. Shakespeare explains the architect thought it allowed the sound to carry well. When questioned as to the whereabouts of Peter Streete, Shakespeare says that he was admitted to Bedlam. The Doctor decides that is their next stop. Shakespeare follows after him after giving his actors the final draft of his play.

Once at Bedlam, Martha is disgusted to learn that the patients are whipped to entertain the gentry. Shakespeare defends it, saying that fear of the place helped "set him right". The Doctor explains that Shakespeare fell into depression after his son's death. Shakespeare then speaks "To be or not to be" from his future play when explaining what he felt then, but wonders if the line is a bit pretentious; the Doctor is indifferent about it. They are lead into Streete's cell, where the Doctor finds he is suffering from catatonia.

Lilith senses this and, along with her mothers, sees the Doctor in their cauldron. She remembers him from the previous night and wonders why he now visits the madhouse with Shakespeare. The Doctor smells of something new to them. Fearing that they be revealed, Lilith has Doomfinger transport herself.

In the cell, the Doctor uses his telepathy to help Peter overcome his condition long enough to help explain what he went through. On the Doctor's order, Streete reveals that witches spoke to him and made him design the Globe to their design, not his own. He also tells the Doctor that the witches were based in All Hallows Street. Doomfinger appears in the cell and kills Peter with a touch. She threatens the others and the Doctor steps forward to confront her. He then begins rambling about the facts: humanoid females that channel energy into power through words. The Doctor figures out that the 14 walls of the Globe are based on the 14 stars of the Rexel configuration. He then names Doomfinger a Carrionite, which causes her to disappear. The Doctor explains the Carrionites produce their "magic" through an ancient science based on the power of words.

Back at the Elephant, the Doctor explains that Carrionites vanished at the dawn of the universe. However, its seems some of them are back. How they managed to get back is quickly figured out by Martha and the Doctor. They planned on using Shakespeare and his brilliant words to bring the rest of their species back; "'Love's Labour's Won' is a weapon!" The Doctor tells Shakespeare to stop the show whilst he and Martha go to All Hallows Street to thwart the witches.

Shakespeare bursts on to the Globe's stage to make the announcement, but two of the Carrionites are already there and use one of their dolls to render him unconscious. The actors — thinking Shakespeare has passed out drunk — carry the playwright offstage and the performance proceeds after they apologise to the crowd. The Doctor and Martha reach All Hallows Street and pause for the Doctor to explain the reality of the danger. They confront Lilith, who is expecting them. She confirms the Doctor's suspicions: the three Carrionites hope to gain entry for the rest of their species, eliminate the humans, begin a new empire on Earth and spread out from there. Martha, mimicking the Doctor's actions at Bedlam, tries to neutralise her by speaking the name Carrionite, but Lilith mocks her, since naming only works once. Instead, she names Martha Jones, rendering her unconscious, muttering that she was unable to harm her more, as she must be out of her own time. Lilith tries to do the same to the Doctor, but fails, as her psychic power is unable to uncover his real name. She senses a name that could hurt him and tries to weaken him by naming "Rose", but he assures her that that name keeps him fighting and demands to know how the Carrionites came to be on Earth.

Lilith explains the Eternals found the correct word to banish the Carrionites into darkness, but the three were able to escape using the power of Shakespeare's grief over his son — the grief of a genius — and intend to free the others. She approaches seductively, which the Doctor says that it definitely won't work on him, and then quickly cuts a lock of his hair. Taking flight through the window, she attaches the hair to a doll — which the Doctor says is basically a DNA replication module — and stabs it in the heart. The Doctor collapses, making Lilith think he's dead. She flies to the Globe, leaving them behind. Martha awakens, thinking the Doctor is dead as well, but finds he's still alive - two hearts. With her help, the Doctor manages to re-start his other heart. They proceed to the Globe to stop the Carronites.

However, at the Globe, the actors have already spoken the last lines of the play. Much to the horror of the audience, Carronites emerge from a crystal held by the three and swarm outside. The Doctor and Martha arrive to find Shakespeare regaining consciousness and rubbing his head in pain. After making a joke about his eventual balding, the Doctor goes on stage to try undoing the damage, but finds only William can. Joining the Doctor, Shakespeare is told to improvise a verse to get rid of the Carronites. The Carrointes in the theatre wither in fear of his words, but William gets stuck on the last one, unable to think of a rhyme. Martha comes up with "Expelliarmus" (a magic word coined by author J.K. Rowling in her Harry Potter books) and the Carrionites — together with all the extant copies of Love's Labour's Won — are sucked through the portal. Martha, Shakespeare and the actors are left to take the applause of the audience who thought it was special effects. The Doctor finds the three 'witches' trapped, screaming in their own crystal ball and decides to keep it in a "dark attic" of the TARDIS.

In the morning, Shakespeare flirts once more with Martha...and with the Doctor. He reveals his deduction that the Doctor is not of the Earth and that Martha is from the future. For his "Dark Lady", he produces the sonnet, "Shall I compare thee to a summer's day?" in her honour, but is interrupted when two of his actors burst in, heralding the arrival of the Queen, who wants to see the play from last night. Queen Elizabeth enters, much to the Doctor's amusement. However, it seems they have met before in her past; he is deemed her "sworn enemy". The Queen declares, "Off with his head!"

This shocks the Doctor as he has yet to meet her, but comments that he is looking forward to finding out what he will do to offend her. He is then forced to run by Martha to keep himself alive. They run through the streets back to the TARDIS as the guards run after them. They enter the TARDIS, slamming the door just as an arrow embeds itself in the TARDIS' exterior before dematerialisation.

Cast

 * The Doctor — David Tennant
 * Martha Jones — Freema Agyeman
 * William Shakespeare — Dean Lennox Kelly
 * Lilith - Christina Cole
 * Wiggins - Sam Marks
 * Doomfinger - Amanda Lawrence
 * Bloodtide - Linda Clarke
 * Richard Burbage - Jalaal Hartley
 * Will Kempe - David Westhead
 * Dolly Bailey - Andree Bernard
 * Lynley - Chris Larkin
 * Jailer - Stephen Marcus
 * Peter Streete - Matt King
 * Preacher - Robert Demeger
 * Queen Elizabeth - Angela Pleasence

Culture

 * There are numerous Harry Potter mentions and references - "Expelliarmus", as well as "Wait till you read book seven, I cried." (The episode was broadcast roughly three months before the book was released.) David Tennant also had a role in the fourth Harry Potter film.
 * Martha references the butterfly effect when asking about the repercussions of time-travel. The effect was named from the story A Sound of Thunder. In this short story by Ray Bradbury, a man named Eckles travels back in time and accidentally steps on a butterfly. It results in the entirety of history changing and eventually causes his death.
 * Martha references the Grandfather Paradox, most famously dated back to the 1944 story Le Voyageur Imprudent by René Barjavel, although the concept is mentioned in passing in a 1929 tale by Cloukey called Paradox.
 * The Doctor uses the 1980s film Back to the Future to explain the mechanics of the infinite temporal flux in relation to time travel to Martha.
 * The Doctor quotes a line from Dylan Thomas' poem "Do Not Go Gentle Into That Good Night" ("Rage, Rage against the dying of the light."), before telling Shakespeare he can't use it.
 * In attempting to explain Martha to Shakespeare, the Doctor claims that she comes from Freedonia, a fictional country featured in the Marx Brothers film Duck Soup.
 * Near the climax, the Doctor admonishes Shakespeare that "We can have a good flirt later." Shakespeare coyly replies, "Is that a promise?", to which a stunned Doctor says, "And 57 academics just punched the air!" This is a reference to current academic theories that claim that many of Shakespeare's sonnets were penned as love sonnets to a man, and that Shakespeare himself was either bisexual or homosexual.
 * Shakespeare's attraction to Martha and referring to her as "The Dark Lady" seem to be references to Shakespeare's purported lust for black women, also referenced in Anthony Burgess' novel Nothing Like the Sun.
 * The Carrionite Lilith's name derives from a Succubus who would visit men in their sleep. In this case Lilith was placing ideas into Shakespeare's mind in order to bring more Carrionites through. But in many cultures these night time visits brought others of her kind through by a more primal route.
 * Shakespeare ends up uttering a quote he will use later in Hamlet ("To be or not to be...."). Centuries later, the Royal Shakespeare Company will put on Hamlet (Starring Sir Patric Stewart) and none other than David Tennant (as Hamlet) will utter those same lines in his famous sillioquoy.

Story notes

 * The episode bears some similarities to the previous Gareth Roberts' penned comic story featuring Shakespeare and the Ninth Doctor, A Groatsworth of Wit, which may have provided some of the inspiration for this episode.
 * The title appears to be a play on The Da Vinci Code, which is also a story based around a well-known figure of the Renaissance.
 * This was the second appearance of a famous writer in the revived series, the first being Charles Dickens in TV: The Unquiet Dead.
 * This episode's working titles were Theatre of Doom and Love's Labours Won.
 * is a fictional country from the comedy film Duck Soup.
 * Shakespeare did use the word Sycorax in his play The Tempest.
 * Shakespeare referred to Martha as the "Dark Lady," the mysterious subject (though perhaps allegorical) of many of his sonnets.
 * The story plays on the speculation around Shakespeare's Love's Labour's Won, a possible 'lost play' or alternate title for an existent play.
 * The story has Elizabeth I mentioning that she swore to have the Doctor killed; this probably has something to do with the Doctor mentioning she could no longer be called the Virgin Queen in TV: The End of Time.
 * Lilith's name is a probable reference to the mythical "first wife of Adam" in Christian and Jewish folklore.
 * Angela Pleasence (Queen Elizabeth I) would later play Mystic Mags in TV: The Curse of Clyde Langer.
 * As is routine for post-2005 Doctor Who, a "NEXT TIME" trailer for the next episode is shown at the end of the episode.

Ratings

 * 7.22 million viewers - BARB final ratings
 * 6.8 million viewers - Overnight ratings
 * 1.039 million viewers - BBC3 Repeat ratings

Filming locations

 * Ford's Hospital, Greyfriar's Lane, Coventry
 * Lord Leycester Hospital, Warwick
 * Newport Indoor Market (Basement), Newport
 * Chelesmore Manor House, Greyfriar's Lane, Coventry
 * Shakespeare's Globe, Southwark, London
 * BBC Studios, Upper Boat, Tonteg Road, Treforest Industrial Estate, Pontypridd
 * Stageworks, Unit H1, Colchester Industrial Estate, Colchester Avenue, Penylan, Cardiff
 * Black Horse Ltd, St William House, Tresillian Terrace, Cardiff

Production errors

 * When the Doctor and Martha are in their bedroom, there are many candles lit. Later, when Martha blows out one candle, the whole room goes black. (Not necessarily an error, just a visual effect to change scene)

Continuity

 * The Doctor and Martha visit the Globe Theatre, as the First Doctor's companions Ian Chesterton and Barbara Wright had intended to do in November 1605 before becoming embroiled in the Gunpowder Plot. (PROSE: The Plotters)
 * Lady Peinforte previously fired an arrow into the door of the TARDIS. (TV: Silver Nemesis)
 * Shakespeare has previously appeared: as a young boy in AUDIO: The Time of the Daleks, on the Space Time Visualiser in TV: The Chase, as an older man (who hitches a ride aboard the TARDIS) in AUDIO: The Kingmaker and PROSE: The Empire of Glass.
 * The Doctor also reads mind in TV: The Girl in the Fireplace and TV: Fear Her.
 * The arrow that is shot into the TARDIS mimics similar occurrences in TV: An Unearthly Child and TV: Silver Nemesis.
 * The arrow shot into the TARDIS is still there in the next episode and is removed by the Doctor after materialising. (TV: Gridlock)
 * Queen Elizabeth's anger at the Doctor is given a possible cause in TV: The End of Time, when the Doctor indicates that he had married her and then left unexpectedly, during an event later in his timeline but earlier for her.
 * The Doctor also mentioned meeting Queen Elizabeth in TV: The Mind of Evil.
 * Lilith's name is only said once throughout the whole episode. It is only said in the beginning when the young man tells Lilith that her house is foul. Her name is not even said by Bloodtide, Doomfinger or Lilith herself.
 * The Doctor claims that Martha is a citizen of the nation of "Freedonia". Freedonia was the name of a planet in PROSE: Warmonger.
 * The Doctor uses the title of "Sir Doctor of TARDIS". (TV: Tooth and Claw)
 * The Doctor's elder brother, Irving Braxiatel, would later obtain a copy of Love's Labour's Won for the Braxiatel Collection. (PROSE: The Empire of Glass)

Home video releases

 * This story was released with Smith and Jones and Gridlock on the Series 3 Volume 1 DVD.
 * It is also included in the Series 3 DVD box set.