In "", Barclay unwittingly revives a sentient holo-simulation of Sherlock Holmes' arch-foe, Professor James Moriarty (previously seen in "Elementary, Dear Data") while performing holodeck maintenance. This results in Picard, Data, and Barclay unknowingly becoming trapped in a Moriarty-created simulation of the "Enterprise", and forced to research a method of making holo-simulations "real" outside of the holodeck through Moriarty's manipulations. When the ruse is discovered, Moriarty and a holographic companion are tricked into a simulation within the simulation, and stored in a computer where they will continue to exist, believing that they have gained freedom from the holodeck.