When Marge meets Ralph Wiggum, she decides to invite him over for a playdate with Bart. Bart initially rejects Ralph, but when he goes over to the Wiggum household and sees that it's filled with police equipment and files, he finds himself in a troublemaker's paradise. The two boys start hanging out more and more, eventually having a sleepover during which they steal Chief Wiggum's master key and let themselves into every building in Springfield. In the middle of their spree, Bart and Ralph run into Nelson and his bully buddies. Trying to impress them, Bart shows them the master key and the whole group ventures into the abandoned prison. While there, they play with the electric chair, but leave before they can use the key to turn it off again. When Mayor Quimby decides to reopen the prison, he calls a press conference and sits in the electric chair to demonstrate how it works. Watching the event on TV, Bart and Ralph are sure that Quimby will be killed if anyone flips the electric chair switch. With a little help from Mr. Burns, however, the mayor escapes his fate. After going through so much together, Bart and Ralph remain friends.