"House of Whacks" was co-written by John Frink and Don Payne. Payne, who conceived the story of the segment, based it on Stanley Kubrick's film "". The segment would originally end with the Ultrahouse killing Homer, and, for compensation, the family would program the house with Homer's personality. The Ultrahouse was portrayed by Pierce Brosnan, however he was not the staff's first choice for the role. The role was originally intended for Sean Connery, and over the course of production, the staff considered Lyle Lovett and Gary Oldman for the role. The decision remained until "someone who worked for decided it was somehow insulting to have him play a house", according to Scully. At this point, the staff settled on Brosnan. Scully stated that "Brosnan wound up doing a great job" and that working with him was "really funny". Originally, the Ultrahouse would have a pompadour and play the guitar, however they changed its mannerisms to suit Brosnan's performance better. Matthew Perry also made a guest appearance, playing himself as one of Ultrahouse's voice options. Regular cast member Dan Castellaneta portrayed Dennis Miller in the segment (a special ending credit had to be made to avoid confusion with viewers who thought the real Dennis Miller did voice-work on the show). One scene was cut from the segment. The scene would take place during Marge's call to the police station, where police chief Clancy Wiggum, while answering Marge's call, is being shot at by "RoboCops".