In Sudan, he had to devise an entirely new legal system, the criminal part of which was largely based on the Indian Penal Code. He held the post, latterly also an Official Member of the Council of the Governor-General of the Sudan, until 1919, when he was appointed Senior Judicial Officer of Mesopotamia (later Iraq), newly under British Mandate after long being a part of the Ottoman Empire. Here he also had to devise a new legal system, adapting the Ottoman system to fit in with modern British ideas of justice, but not imposing too many foreign ideas on the country's longstanding legal system.