 While Lt. Barclay is fiddling with the controls in one the holodecks, he inadvertently unlocks Data s Sherlock Holmes mystery, which includes Holmes  arch nemesis, Professor Moriarity. Since the professor was promised by the crew that they would try and figure out a way for him to leave the holodeck the last time they saw him, he seeks an audience with Capt. Picard to discuss his situation. His demands to be able to leave the Holodeck are not taken seriously enough and takes control of the starship. If the professor and his love, the Countess Barthalomew, are not allowed to leave the ship on their own, he will destroy the Enterprise and its crew.