Episode 9 of Season 7 of NBC’s cop comedy series ‘Brooklyn Nine-Nine’ began at a usual pace. There was a special task force being formed, and of course, Jake (Andy Samberg) wanted in. Jake has historically always wanted in on all “cool” missions and task forces, so this was hardly out of the ordinary — in fact, had Jake not volunteered for it, it would have been decidedly weird.

Even as Jake was making his case to now-Captain again Holt (Andre Braugher), things “blew” way out of proportion. There was an explosion in the Nine-Nine precinct! A glitter-bomb (of course, it was a glitter-bomb; you wouldn’t expect a real life-threatening bomb in ‘B99’, would you?) on Jake’s desk exploded right on to Scully’s (Joel McKinnon Miller) face.

Suddenly, the episode turned into a whodunnit. One can surmise that this was a prank-gone-wrong, and if someone was trying to prank Jake, it had to be someone Jake had pranked before. Which could literally be anybody in the precinct; or even outside of it because Jake, after all, is “the Prankmaster General”.

Chaos ensued as the whole precinct (well not the whole precinct; just the main characters) pointed fingers at each other. It could have been Amy (Melissa Fumero), it could have been Boyle (Joe Lo Truglio), it certainly could have been Terry (Terry Crews) — well it really couldn’t have been Scully and Hitchcock (Dirk Blocker), because they are too dumb and lazy to come up with a prank like this.

To solve this Agatha Christie-esque whodunnit — or as Holt calls it, “who has done this” — the captain decided to bring in outside help. A man called Frank Dillman of the San Francisco Police Department. Lo, and behold! A fantastic cameo from the incomparable JK Simmons.

Dillman had the detective abilities of Sherlock Holmes (or Hercule Poirot, if we are going with the Christie theme), and the stern mannerisms of Holt. In other words, he was a force to be reckoned with.

While Jake tried his best to outdo Dillman, especially to prove to Holt that he deserved to be on the special task force, Dillman was at least three steps ahead of him. Jake’s attempts to catch the prankster was foiled by Dillman every time, thanks to his weirdly advanced knowledge of glitters.

The only time Dillman mildly met a match was when he interrogated Diaz (Stephanie Beatriz), as they bantered on and on about a soap opera both watched religiously. But a twist — and it was quite the twist — arrived in the plot when Jake began to question Holt’s alibi for the lunch hour when the prank would likely have been set up. Holt claimed he was having lunch with Boyle, a claim that everyone said was far fetched. But it wasn’t. Holt was having lunch with him to offer him the position in the special task force. Audible gasp, right?

As Jake and Boyle tried to talk this through, Dillman announced that he had an important announcement to make. Another twist: Dillman concluded that it was Jake himself who had set up the prank, in order to solve it and prove to Holt that he was a good fit for the task force. Holt suspended Jake. But like any classic whodunnit, things were far from over.

Jake soon found evidence that visibly put Dillman into the spotlight of suspicion. One, he too wanted to be on the task force. Two, he no longer was a cop. He was fired and presently worked at a hobby shop where glitter was aplenty. But as it turns out, it wasn’t Dillman either!

With the big reveal, arrived Boyle. It was not a prank, but rather an elaborate attempt to destroy flimsy evidence from going to court. And the person who was behind it was the assistant district attorney. Really, who could have seen that coming in any way?

All in all, this “who has done this” was as satisfying as it was funny.

'Brooklyn Nine-Nine' Season 7 airs on Thursdays, at 8.30 pm only on NBC.