Iran nuclear: Rouhani changes tone but Khamenei has final say
"In Iran, we don't have homosexuals as you do in your country. In Iran, we do not have this phenomenon."
President Mahmoud Ahmadinejad, New York, September 2007.
"I would like to say to American people: I bring peace and friendship from Iranians to Americans."
President Hassan Rouhani, New York, September 2013.
Hassan Rouhani's tone in New York was startlingly different from that of his predecessor. During his annual trip to the US, Mahmoud Ahmadinejad enjoyed goading, provoking and attempting (unsuccessfully) to convert his audience to his way of thinking.
By contrast, Hassan Rouhani, has used his first trip to New York to engage delicately with an old enemy and to put in place a structure for talks about Iran's nuclear programme. But he also chose not to break three decades of tradition in the Islamic Republic - and declined to meet President Obama.
Hassan Rouhani's actions in New York reveal a man dealing with the inherent, overwhelming contradiction of his job: he has a popular mandate without actual power.
In June, Iran's electorate overwhelmingly endorsed his promise of engagement and moderation. But Iran's presidency gives Mr Rouhani very little formal power with which to fulfil his promise.
In Iran, the president is outranked by the country's Supreme Leader, Ayatollah Ali Khamenei. Section 1, Article 110 of the Constitution states that the Supreme Leader has responsibility for "Delineation of the general policies of the Islamic Republic of Iran after consultation with the Nation's Exigency Council."
For more than three decades, those general policies have included hatred of the United States. Iran's new president cannot change this policy on his own. Hassan Rouhani knows the one key rule of Iranian politics - if daylight opens up between the supreme leader and the president, the supreme leader always wins.
From 1997 to 2005, the reformist President Mohammad Khatami tried to bring about change - but he failed to persuade the supreme leader that this was worth doing. So the Supreme Leader overruled him, and Mr Khatami's reforms largely failed.
Hassan Rouhani has chosen to avoid the making the same mistake. He is choosing to work in close alliance with the ayatollah. It helps that the two men have known each other for decades - they are from the same founding generation that overthrew the Shah in 1979.
The key to Mr Rouhani's entire presidency will be his ability to persuade the ayatollah, and the ayatollah's allies in the Revolutionary Guards, to give him enough room to explore diplomacy. The question is not so much, does Iran's president want change? But, does the supreme leader?
For the last 24 years, the ayatollah has put down all challenges to the conservative nature of the Islamic Republic. In 2009, his forces ended the demonstrations led by the supporters of the opposition Green Movement. Earlier this year, Ali Khamenei's allies on the Guardian Council disqualified from the presidential election a number of candidates who were not seen as reliable loyalists.
But, crucially, the Ayatollah allowed Hassan Rouhani to run. It may be that the 74-year old Ali Khamenei trusts his old friend to bring about limited change without threatening the nature of the republic.
So, the supreme leader has given a limited endorsement of his president's desire to pursue diplomacy.
In a speech given on 17 September in Tehran, Ali Khamenei approved the use of "heroic flexibility" in diplomacy. This would appear to translate as an instruction to President Rouhani: by all means see what you can get from the Americans, but don't go around shaking Obama's hand.
The ayatollah-approved outreach in New York included the first sustained direct talks between the US and Iran at foreign minister level for more than 30 years.
'Stop, shut, ship'
Direct contacts between the two countries will continue in Geneva on 15 and 16 October when Iran and the US join the UK, China, France, Russia, and Germany for a formal round of talks about the Islamic Republic's nuclear programme.
In previous rounds of talks, the world powers have made three demands of Iran: stop the enrichment of uranium, shut down the fortified enrichment facility at Fordo, and export its supply of low- and medium-enriched uranium (a demand known as "stop, shut, ship").
Iran has rejected these demands. Instead, it wants sanctions to be lifted - and the Islamic Republic's right to enrich uranium to be acknowledged.
It is not yet clear whether or not these demands and counter-demands will be the starting point for the new round of talks in Geneva in October. But it is clear that the talks restart in an improved atmosphere.
Previous rounds (I attended all seven held in the past three years) were often parallel monologues with little actual negotiation.
This time, all sides appear to be more willing to engage in give and take. They have even managed to avoid their usual argument about where they should meet.
Previous negotiations were delayed by Iran's unhappiness about meeting in Geneva. As a result, the talks went on an unofficial world tour to Istanbul, Baghdad, Moscow and Almaty.
The Foreign Minister, Mohammad Javad Zarif, will chair the talks for Iran. Mr Zarif will report directly to President Rouhani. In turn, the president will report to the supreme leader.
Hassan Rouhani may be able to recommend a deal, he may be able to explain how concessions are the best way to get sanctions lifted, and improve the lives of ordinary Iranians. But in the end, it is the supreme leader who will have the final say.