The British East India Company had traded with India since the 1600s and, by the beginning of the 18th century, had established trading bases at coastal points, including Calcutta, Bombay and Madras. The main goods traded were cotton, sugar, indigo and opium. The Mughal emperors who dominated much of the subcontinent supported the Company, but by the 1740s the Mughal Empire was beginning to fracture and several rival groups allied themselves to the British or French in the Carnatic Wars of the 1740s and 50s. The British, under the command of Robert Clive, ended up in control of a large swathe of territory, including Bengal, Northern Circars, Goa and Madras. In 1765 the Mughal emperor, defeated by East India Company troops was forced to dismiss his own revenue officials, who were replaced by English traders appointed by the new governor of Bengal, Robert Clive. From this point on the East India Company, assisted by its own private army, collected Mughal taxes. The British East India Company continued to engage in many regional wars, most notably with the Kingdom of Mysore in Bangalore and the Maratha Confederacy in north-central India. By 1818 the unregulated private company had gained control of most of the subcontinent.