During the Classical period Athens denotes both the urban area of the city proper and its subject territory (the Athenian city-state) extending across most of the modern Attica region except the territory of the city-state of Megaris and the island section. In 500 BC the Athenian territory probably contained around 200,000 people. Thucydides indicates a 5th-century total of 150,000-350,000 and up to 610,000. A census ordered by Demetrius of Phalerum in 317 BC is said to have recorded 21,000 free citizens, 10,000 resident aliens and 400,000 slaves, a total population of 431,000, but this figure is highly suspect because of the improbably high number of slaves and does not include free women and children and resident foreigners. An estimate based on Thucydides is 40,000 male citizens, 100,000 family members, 70,000 metics (resident foreigners) and 150,000-400,000 slaves, though modern historians again hesitate to take such high numbers at face value, most estimates now preferring a total in the 200–350,000 range. The urban area of Athens proper (excluding the port of Piraeus) covered less than a thousandth of the area of the city-state, though its population density was of course far higher: modern estimates for the population of the built-up area tend to indicate around 35–45,000 inhabitants, though uncertainties persist around density of occupation, household size and whether there was a significant suburban population beyond the walls.