Within the first two minutes of The Hangover, you see Zach Galifianakis’ ass. And later, you’ll see an old man’s ass. And another person’s. And then Galifianakis’ again.

That’s a lot of asses for one comedy—which may as well be the tagline for Todd Phillips’ attempt to recapture the goofy, filthy fun that was 2003’s Old School. But this time, the director had no hand in writing the script, leaving it to co-writers Jon Lucas and Scott Moore to up the crude and oh-no-he-didn’t! factors in this story about a Las Vegas bachelor party gone awry. And considering the pair are best known for penning tepid rom-coms Four Christmases and Ghosts of Girlfriends Past—well, maybe they’re not quite ready to wield pedophile and 9/11 jokes just yet.

Neither is Galifianakis—though it’s unclear based on this film alone what he could make funny. Unless you find this bearded, bloated, man-infant appealing, you’ll surely spend The Hangover wistfully remembering the days when Will Ferrell made good movies and Luke Wilson was still relevant.

Galifianakis plays Alan, an implied child molester who with pals Phil (Bradley Cooper) and Stu (Ed Helms) take Alan’s future brother-in-law, Doug (Justin Bartha), on a trip to Sin City on the weekend of his wedding. At the beginning of the movie, we find Phil et al. stranded in the desert, phoning Doug’s bride-to-be, Tracy (Sasha Barrese) to say they’ve misplaced her groom. Phillips then winds back the clock several days to show getaway prep: Phil, a grade-school teacher, is pocketing the wads of cash he overcharged his students for a field trip. Stu, a knotted-sweater-wearing dentist, is lying his ass off to his shrew of a girlfriend, Melissa (Rachael Harris), reassuring her that his friends are more mature than she thinks and that they are really spending a quiet weekend in Napa (cue them pulling up outside and yelling: “Paging Dr. Faggot!”). And Tracy’s father (Jeffrey Tambor) is bestowing upon Doug the honor of taking his Bentley, with the promise that no one but he drive it. Yeah, right.

So the boys hit Vegas and ready themselves for a night on the town. They’re on the roof of their hotel, toasting Doug with Jager shots. And then Phillips employs the film’s sole stroke of genius: He cuts to the messy morning-after. The hotel suite is trashed, stuff is smoking, there’s a tiger in the bathroom, and Doug is missing. Which means the bulk of The Hangover is devoted to the guys’ detective work as they try to find Doug and piece together what the hell went down.

Even if you find much of the humor tedious—really, you may feel a lot like Stu as he cringes at his friends’ every irresponsible move, from forcing him to put the suite on his credit card to nearly crashing the Bentley for laughs—this nugget of mystery at least keeps the story interesting. A scene in a police station is also a small pleasure, as the three remaining musketeers are used as bad examples and Tased in front of a classroom of kids. Until a late-chapter Rain Man parody, Galifianakis’ Alan grates as he French-kisses dogs and says things like, “Ha-ha-ha, drunk driving! Classic!” But Helms and even the usually bland Cooper are much more entertaining, the former as an increasingly freaked-out good boy and the latter a dryly funny weekend partier. A return of the Dan Band, who filled Old School’s wedding with expletive-laden crooning, is also a highlight.

The best part of The Hangover by far, though, is the end credits, a photo montage that finally shows you what exactly happened the night they lost Doug. As Stu once yells, “This whole situation is completely fucked”—but Phillips’ inspired Hail Mary makes up for it.