Some precolonial trading cities retained their functions under colonialism for example Malacca and Makassar became important garrisons and ports and some in digenous inland capitals such as Phnom Penh, Jogjakarta Mandalay and Hanoi as well as many smaller regional centers were "adopted" as administrative centers in the colonial political economy which organized the collection of surplus from the rural hinterland and exported it to European and colonial markets