A nationwide judicial system in Iran was first implemented and established by Abdolhossein Teymourtash under Reza Shah, with further changes during the second Pahlavi era. After the 1979 overthrow of the Pahlavi dynasty by the Islamic Revolution, the system was greatly altered. The legal code is now based on Islamic law or sharia, although many aspects of civil law have been retained, and it is integrated into a civil law legal system. According to the constitution of the Islamic Republic, the judiciary in Iran "is an independent power" with a Ministry of Justice, head of the Supreme Court, and also a separate appointed Head of the Judiciary.