On 30 January 1819 Sir Stamford Raffles, an Englishman who was the Governor of Bencoolen (now Bengkulu, Indonesia), entered into a preliminary agreement with the Temenggung of Johor, Abdul Rahman Sri Maharajah, for the British East India Company to establish a "factory" or trading post on the island of Singapore. This was confirmed by another agreement signed by Raffles, the Temenggung and Sultan Hussein Shah on 6 February. In June 1823 Singapore ceased to be a dependency of Bencoolen and was placed under the control of the Presidency City of Calcutta (Kolkata) in the Bengal Presidency. On 24 June 1824, Singapore and Malacca were formally transferred to the East India Company, with the result that they came under the control of Fort William. Full cession of Singapore to the Company by the Sultan and Temenggung was effected by a treaty of 19 November 1824, which was ratified by Calcutta on 4 March 1825. Between 1819 and 1826, Singapore was headed by two Residents of Singapore in succession, Maj.-Gen. William Farquhar and Dr. John Crawfurd.