Maybe it shouldn’t come as a surprise that Jon Stewart has put forth such a thoughtful, pertinent first effort with his directorial debut Rosewater. After all, he become world famous for his comedic Daily Show diatribes against the stagnant US political system, corrupt world leaders and human rights atrocities. However, in his new film, Stewart uses the starting point of journalist Maziar Bahari’s 118 day imprisonment in Iran to craft a film condemning of any leadership that values dogmatic hyperbole, and the ignorance of its own people. Rosewater is heartfelt, inspirational, and startlingly funny. Even through its jarring tonal shifts, it serves as an effective message movie from the first time writer/director.

Rosewater‘s chronology begins 11 days before Maziar’s imprisonment, as the Iranian-Canadian “NewsWeek” reporter travels to Iran to report on the historic 2009 presidential election. When arriving at the airport, Bahari (played impeccably by Mexican actor Gael García Bernal) meets Davood (Dimitri Leonidas), a driver who helps him get access to parts of Tehran where the different political factions reside. They interview a young supporter (Amir El-Masry) for Ahmadinejad (the famously inept incumbent president) who ardently denies Western media’s reports of possible vote rigging in the upcoming election. “Ahmadinejad is what must be,” he states firmly, with no trace of irony.

Davood brings Bahari to see another side, a group of young Mousavi supporters (or “not Ahmadinejad” supporters). These dissenters have formed their own system of education known as “Dish University,” a set of illegally obtained satellite dishes streaming in news from around the globe. However, when shown the collection of satellites, Bahari puts away his camera. “There are certain situations, if you film them, it won’t do your friends or the movement any good,” he says, fearing that any broadcast of this set up would only antagonize an already easily agitated government.

Dynamics shift in the following days as Ahmadinejad unexpectedly (depending on whom you ask) takes the election in a landslide, and the sizeable anti-Ahmadinejad contingent take to the streets in protest. For Bahari’s mother (Shohreh Aghdashloo), who has already seen her husband and first-born daughter taken captive by the two previous Iranian regimes, the news of corruption in the voting comes as no surprise. As Bahari continues to cover the conflict, he’s witness to the brutalities suffered by those working against the establishment. After some hesitation, Bahari turns his lens towards the fighting despite the knowledge that it will likely ruffles the feathers of an irritable regime.

Bahari informs his concerned, pregnant wife that he needs to remain in Iran longer to bear witness to these historic events, but no one knew just how long he would ultimately stay in the country. Shortly after filming a particularly frightening clash between soldiers and protestors, a group of government officials, led by the man who Maziar labels “Rosewater” (Kim Bodnia), arrive at the Bahari household to investigate him. Without further explanation, the men escort Maziar into the back of their car and off to the unnerving Evin Prison.

It’s here in the prison’s solitary confinement and interrogation rooms where most of Rosewater takes place. Subjected arbitrarily to absurd lines of questions, harsh beatings and other methods of torture, Maziar’s attitude shifts between amused, confused, hopeless, hopeful, and even suicidal. This section of Jon Stewart’s film is where he shows some of his inexperience as a filmmaker, as the progression of scenes is a bit uneven, yet the experience is akin to the randomness Bahari faced in detainment. Like Bahari, it’s hard for us as the audience to know what will happen next, whether it’s Rosewater accusing Bahari of being a spy for NewsWeek, the media of the CIA, or a line of questions about Bahari’s three visits to the state of New Jersey.

The absurdity of Rosewater’s accusations creates much of the movie’s dark laughs. The weight with which Bahari’s interrogator lobs questions such as, “How many Jews for NewsWeek?” would be silly if he didn’t feel uncomfortably true. Hearing doctrine shot down with terse phrasing has long been a strength of Jon Stewart’s, and while this situation is far from a laughing matter, the inclusion of these moments never feel misplaced or excessive (and reportedly, many moments are lifted directly from Bahari’s book And Then They Came For Me).

One of Stewart’s greatest feats with Rosewater is in not simplifying its character into one-dimensional representatives of good or evil. Bahari has many moments of weakness, even agreeing to confess (under duress) to working with spies to bolster the revolution. More notably is the portrayal of the interrogator Rosewater as a simple cog in a bureaucratic process, a lackey for someone with a bigger office and grander title. Even Rosewater’s boss, who oversees all the beatings and torture tactics employed in Evin Prison, has his paranoia colored by the United States’ involvement in the 1953 Iranian coup and Iran-Contra.

Rosewater is a movie that allows Jon Stewart the platform to bring his Daily Show sensibilities to a medium with a wider reach, and longer shelf life. His film is entertainment in a surprisingly literal way, considering the subject matter, but it’s simultaneously a film firmly devoted to illustrating an idea: corruption fails under the existence of transparency. While the movie falters at times, notably with its heavy incorporation of graphic overlays to illustrate media coverage and social media use, it’s captivating and ultimately optimistic, and definitely worth checking out.