While in Vic Fontaine's holosuite club, Miles and Julian try to convince Vic to join them in their Alamo program. Vic declines, and instead offers to sing a tune to get them into a "Texas frame of mind." In the middle of Vic's Alamo rendition, however, he is suddenly booed off the stage, as a new, raunchy act emerges from behind the curtain, stealing Vic's show. Confused and in a state of disbelief, Vic gets shuffled by the crowd; when the crowd parts, he is confronted by Frankie Eyes, a gangster with an axe to grind against Vic. Frankie abruptly informs Vic that he has recently purchased the hotel, casino, and lounge. Vic, who is no longer welcome in the club, is being replaced with a new act.
Miles requests that the computer remove the two new, offending characters from the program, but nothing happens. So he tries to freeze the entire holosuite program, again to no avail. Frankie is accompanied by a thug, Tony Cicci, who begins to get physical with Vic, as Frankie demands Vic leave the premises. To defuse the situation, Vic agrees to leave peacefully, while Frankie checks out his new casino. Julian and Miles discuss how to fix the errant program, but they frighten Vic by suggesting they may have to wipe out part of his memory. They agree to find another, less destructive way to save their holographic friend.
Back in Ops, the crew members debate the true value of a holodeck "friend," with Worf arguing that Vic is merely a hologram, and should be treated as such, even if he is talented entertainer. Miles, Nog, and Kira all argue that Vic is "more than just a program." Julian soon learns that the new adversarial holosuite character has been implanted purposefully by Felix, the designer of the program, as a jack-in-the-box, a character buried very deeply within the program storyline, and not easy removed. Felix warns Julian that the jack-in-the-box is also period-specific, meaning that it must be beaten with 1962 means and methods, or else the integrity of the entire program, and Vic's existence, may be jeopardized. Captain Benjamin Sisko emerges from his office and asks what everyone is talking about. The crew explain what's happened to Vic, but are surprised when Benjamin isn't interested and orders them all back to work. Nog promises his help, since Vic saved Nog after he lost his leg. Kira promises her support, as well as Odo's, too.
Meanwhile, Benjamin and Kasidy are enjoying a quiet, romantic dinner, when Kasidy broaches the subject of Vic's dilemma. Benjamin is surprised to find Kasidy coming to Vic's defense, insisting that Vic is more friend than program. Back on the holosuite, Miles and Julian go to room 107, Vic's room in the hotel, only to find Vic beaten and bruised, and still shaky on his feet. With three bruised ribs and a sprained wrist, Vic explains how we was roughed up as a warning message to speed his departure. Frankie is a childhood rival from Vic's youth, whom Vic used to beat mercilessly in street stickball, playing as children. Miles and Julian promise Vic they will hatch a plan to end the jack-in-the-box threat.
Kira and Odo begin infiltrating the revamped casino and club, now crawling with gangster clientele; Vic's band has been replaced by a number of sultry, burlesque dancers and blues musicians. Odo, enchanted by the action on-stage, befriends Cicci and the other gangsters at the bar. Kira, meanwhile, is approached by Frankie, who takes an obvious interest in her. Kira accompanies Frankie to the roulette table to distract him, while Odo endears himself to Cicci by effortlessly stretching his changeling arm, in what appears to be the best bar trick ever concocted. In this way, Odo learns from the henchmen that Frankie is merely a pawn of Carl Zeemo, a big-time gangster who is behind the purchase of the hotel.
Back in Vic's hotel room, the gang (which now includes Kasidy and Ezri Dax) begins planning the fall of Frankie Eyes. Vic explains how Frankie's business works by him paying "skim" money to the big boss every month. The main stash of mob money is locked in a safe in the casino Countroom, guarded by Countmen and a Guard. Each person begins preparing his or her part of the plan.
Frankie shows Kira to the Countroom, where large amounts of cash are accumulated and stored in the safe. Kasidy, playing her part as a casino gambler, continually tries to strike up a conversation with the Countroom Guard, distracting him from his duties. Odo introduces Ezri as someone new in town, whereby Cicci immediately hires her as a cocktail waitress. Vic appears on the casino floor, pleading with Cicci to allow him to see Frankie. Frankie, accompanied by the cool-acting Kira, rebuffs Vic's advances rather insultingly, and leads Kira toward the poker table.
Benjamin expresses to Kasidy his reluctance about the majority of his senior staff involving themselves in the Vic Fontaine holosuite program. Kasidy defends their actions as friends helping out friends in need. When pressed, Sisko further explains that he feels uncomfortable with the setting (Las Vegas 1962), because of the racial strife of the era. Kasidy responds by explaining that Vic's program is not designed to contain any of the racial tensions of 1960s Earth. Rather than ignoring these issues, she believes, they can act out how things could have been, almost in a Utopian-type environment, where one's only limitations are "the ones we impose on ourselves." This has a noticable effect on the Captain.
In the hotel room, the characters realise that in order to pull off their plan, they need another person helping. With Worf and Quark most likely unwilling to help, the gang begin to worry until, to their surprise, Benjamin enters the room promising his support, having been swayed by Kasidy's argument.
Now the characters finalize their plans. Kira will begin their elaborate ruse by keeping Frankie preoccupied; while he is busy flirting with her, he will become oblivious to what happens on the casino floor. Vic and high-roller Benjamin will then attract a lot of attention at the gaming tables by throwing around a wad of cash. At precisely 11:45 p.m., Julian will slip a few drops of ipecac into a martini being delivered by Ezri to the Countman in the Countroom. On the casino floor, Kasidy and Miles will create a disturbance as victim and pickpocket, respectively, to distract the Guard. When the Countman becomes physically ill from the tainted drink, he will rush out of the Countroom, leaving it vulnerable to Nog and Odo, who will disguise himself as Ezri's tray. Nog, using his superior Ferengi hearing, will pick the lock on the safe, while Odo will shapeshift part of his arm into a suitcase, with which to carry away the million dollars.
The entire caper should take, by Benjamin's estimate, eight minutes; Julian unabashedly predicts it will take only five. They will need to carry out their plan the following night, as Frankie's big boss Zeemo will arrive the night after to collect his skim money. The following night, all decked out in 1960s period attire, the eight participants march through a half-empty Quark's Place into Vic's, turning many an eye in the joint. Quark, who has traditionally viewed Vic as competition, and has never gotten close, remarks, "I'm telling you, Morn.... Something's going on at Vic's that we don't know about."
Sisko's crew walk towards the holosuite.Their plan underway, Kira enters to distract Frankie. Julian orders his vodka martini (stirred, not shaken) from Ezri. Vic encourages Benjamin to loosen up the purse-strings, so as to appear the part of high-roller; he reluctantly increases his wager from $100 to $2,000. Kira lures Frankie into a private table in the restaurant, away from the action.
When a rogue customer accidentally spills Ezri's drink tray, Julian saves the moment by grabbing another drink, tainting it, and handing it to Ezri for delivery. Their plans take another turn for the worse when the regular Countman is not there, replaced by an acerbic, insulting man. After a brief reparte, Ezri finally persuades the new Countman to gulp down the drink, while Benjamin and Vic do their thing at the tables. Kasidy and Miles easily distract the Guard (perhaps too easily, as Miles will soon discover), so Nog slips into the Countroom when the Countman scrambles to the restroom.
Nog, who was unprepared to find the safe employing an auto-relock tumbler, cannot crack the lock. In the meantime, all the other participants stretch out their parts, so as to give Nog longer to achieve his goal. With Kira slowly nursing her drink, Frankie is surprised to have a guest ... the big Mr. Zeemo himself, arriving in town a day early to collect his money - the very money Nog and Odo are trying desperately to get their hands onto in the Countroom!
Kira, pausing for time, exclaims what an honor it is to meet him, to which Mr. Zeemo replies matter-of-factly, "I know." Nog, still struggling with the safe, is informed by Odo that they've expended their alloted eight minutes. Julian, discarding a winning full house hand, walks away from the poker tables to intercept the second Countman, re-routing him away from the Countroom. Vic causes a scene by insulting Mr. Zeemo's escort, a young blonde beauty, only to be escorted away himself by Cicci. As a last resort, Benjamin begins throwing money around - literally. He casts handfuls of cash into the air here and there, causing a sensation (and quite a disruption) on the casino floor.
In the Countroom, Nog finally unlocks the door to the safe. Odo begins putting the safe's million dollars into his "briefcase" of an arm, while outside Miles, carrying on the act for too long, gets arrested for stealing. Leading Miles away to a holding cell, the Guard is instructed to perform a stripsearch on the poor chief. Kasidy pretends to break down, to keep the Guard's head turned at the last minute, while Odo and Nog flee the Countroom, making their escape. Their flight takes them, with the money, past Mr. Zeemo, astounded at seeing all the money floating around the casino floor.
Sisko sings.It's a different story in the Countroom, however, as there is no money in the safe, much to the shock of Frankie. Not being able to produce the cash, and appearing to have squandered the money like confetti on the casino floor, Frankie is escorted out dreerily, past the burlesque show, past the blues band, and right past the co-conspirators, neatly lined up at the bar: Julian, the drink-doctorer; Nog, the safecracker; Ezri, the cocktail waitress; Odo, the bag-man; Kira, the decoy; Benjamin, the high-roller; Kasidy, the victim; and, of course, Vic.
As Frankie is lead through the curtains, presumably to meet his doom, the ambiance in Vic's lounge immediately returns to how it was before the Jack-in-the-Box upset everything. Vic offers a glass of the bubbly to each of his co-conspirators (each of his friends) when suddenly Miles appears, putting his jacket (and, presumably, clothes) back on after his encounter with the Guards. Vic agrees to accompany Miles and Julian on their Alamo program any time they desire -- "coonskin cap and all". Vic and Benjamin conclude the adventure by together crooning the duet The Best is Yet to Come to the delight of all.