Kirk and the Enterprise computer become detectives after Scotty is accused of murdering women on a pleasure planet.