The Valeyard had just claimed the Doctor now needs to be tried for genocide. Outraged, the Doctor again claims the matrix has been tampered with. In order to prove it's impossible, the Inquisitor brings in the keeper of the Matrix. He claims changes to the Matrix are impossible because he personally holds the key, which never leaves his side. The Doctor points out it has from time to time when maintenance is needed. Stubbornly, the keeper of the key refuses to admit such an event is possible, and those in possession of the key when not in his hands are "qualified personnel".
When the Valeyard claims the Doctor is just stalling for time, the Inquisitor asks the Doctor if he has any witnesses available that can back up his version of events. The Doctor asks how he'd have witnesses with him, any companions who could back him up are scattered across the universe and all through time. But mysteriously, two capsules arrive carrying Glitz and Melanie. It's revealed the Master has sent them along to 'help' the Doctor. He has penetrated the Matrix (just as the Doctor claimed was possible) and has been following the trial with great interest, though he is not responsible for the alterations.
The Master makes another startling statement when he calls the Valeyard the Doctor. It turns out, the Valeyard in an amalgam of all the Doctors darkest sides, coming between his 11th and 12th regenerations. He's working with the High Council to hide their corruption. They have promised the Valeyard the Doctors remaining regenerations. The Master finally admits he's only helping the Doctor for two reasons. The first is to discredit the Valeyard. The Master hopes the revelations will shock Gallifrey to it's very core. Also, he's helping the Doctor because he wants to kill the Doctor personally. While explaining all this, the Valeyard escapes into the Matrix. The Doctor takes Glitz and follows the Valeyard.
While inside the Matrix, the Valeyard tries to kill the Doctor but the Master gives the Doctor refuge. He continues to relate why he's helping. He admits that the Valeyard, without the good qualities of the Doctor that holds him back, is the ultimate foe. Additionally, he wants to steal the Gallifreyan secrets and bribes Glitz into helping him. Glitz is able to persuade the secrets from Mr. Poppelwick, via use of a gun.
Meanwhile, the Doctor escapes from the Valeyard and finds Mel in the Matrix, she coaxes him out to the trial room where the Inquisitor sentences the Doctor to death. The Doctor agrees to the verdict and heads back to the Matrix. But this is all a ruse, another fabrication of the Valeyards. In the real trial room, the Inquisitor tells Mel they are helpless and cannot interfere. Mel disagrees and steals the Matrix key and runs in to warn the Doctor. But the Doctor knows it was a ruse and was pretending to give up his life to get close to the Valeyard. Once they meet him, they find out he's wired the monitor in the trial room to explode, hoping to kill the Inquisitor and the Timelords in the trial room. Mel runs off to warn the courtroom.
Struggling to save the courtroom, the Doctor narrowly averts the disaster, though a surge still destroys the courtroom monitor and takes out the Valeyard. Meanwhile, the Master tries to install the Gallifreyan data into his Tardis, but it's not authentic and it traps both him and Glitz. Back in the courtroom, the Inquisitor offers her thanks to the Doctor and once again suggests him for the Presidency, to which the Doctor politely declines. He's also delighted to find out, one of the fabrications of the Matrix was the death of Peri. It turns out she's living as a Queen with King Yrcanos. The courtroom clears and the last persons to leave is the keeper of the Matrix key, but it turns out to be the Valeyard in disguise.
WHO: The Doctor (6th)
DEPARTURE LOCATION: Last seen in the Timelord Courtroom.
REASON FOR DEPARTURE: Little is known (in the televised) series as to why the Doctor regenerates. It's possible an explosion in the Tardis as a result of a strong tractor beam can be the culprit.