The Royal Burgh of Haddington (, ) is a town in East Lothian, Scotland. It is the main administrative, cultural and geographical centre for East Lothian. It lies about east of Edinburgh. The name Haddington is Anglo-Saxon, dating from the sixth or seventh century AD when the area was incorporated into the kingdom of Bernicia. The town, like the rest of the Lothian region, was ceded by King Edgar of England and became part of Scotland in the tenth century. Haddington received Burgh status, one of the earliest to do so, during the reign of David I (1124–1153), giving it trading rights which encouraged its growth into a market town. Today, Haddington is a small town with a population of fewer than 10,000 people. But during the High Middle Ages it was the fourth-biggest town in Scotland (after Aberdeen, Roxburgh and Edinburgh). In the middle of the town is the Haddington Town House, completed in 1745 based on a plan by William Adam. When first built, it contained markets on the ground floor, and an assembly hall on the first floor to which improvements were made in 1788, and a spire was added in 1831. Nearby is the Corn Exchange (1854) and the county courthouse (1833). Other notable nearby sites include: the Jane Welsh Carlyle House; Mitchell's Close; and a building on the High Street that was the birthplace of the author and government reformer Samuel Smiles and is marked by a commemorative plaque. John Knox was probably born in Haddington and Knox Academy, the local high school, is named after him. Economy Haddington is located predominantly on the left bank of the River Tyne, and was once famous for its mills. It developed into the fourth-largest town in Scotland during the High Middle Ages, and later was at the centre of the mid-eighteenth century Scottish Agricultural Revolution. In 1641, an Act was passed by the Parliament of Scotland to encourage the production of fine cloth, and in 1645 an amendment went through stating that the masters and workers of manufactories would be exempt from military service. As a result of this, more factories were established; these included the New Mills. This factory suffered during the Civil War with the loss of its cloth to General Monck. A new charter was drawn up in May 1681, and major capital invested in new machinery, but the New Mills had mixed fortunes,