OK, so during Ayatollah Khomeini's rule in Iran, there were three different "executive" positions - the Supreme Leader, the President, and the Prime Minister. Nowadays, ever since the position of Prime Minister was abolished in 1989, it's been down to only two positions - the Supreme Leader and the President. My question on this pertains to the former tripartitie division under Khomeini between Supreme Leader, President, and Prime Minister. Just how did it work, without anyone stepping on anyone else's toes? What distinguisted the Iranian President from the Iranian PM, and in turn how were both of them distinguished from the Supreme Leader?