after the reformation there were a series of attempts to provide a network of parish schools throughout scotland. by the late seventeenth century this was largely complete in the lowlands, but in the highlands elementary education was still lacking in many areas. these schools were controlled by the local church of scotland and provided a basic education, mainly to boys. by the eighteenth century many poorer girls were being taught in dame schools, informally set up by a widow or spinster to teach reading, sewing and cooking. the statistical account of scotland undertaken parish-by-parish by john sinclair in the 1790s indicated that all but the oldest inhabitants were expected to be able to read and that many (although fewer girls) could write and count. however, it also indicated that much of the legal provision of schooling had often fallen into decay. in the burghs there were a range or parish schools, burgh schools and grammar schools, most of which provided a preparation for one of the scottish universities. these were supplemented by boarding establishments, known as "hospitals", most of which had been endowed by charities, such as george heriot's school and the merchant companies schools in edinburgh. the industrial revolution and rapid urbanisation undermined the effectiveness of the scottish church school system, creating major gaps in provision and religious divisions would begin to undermine the unity of the system. the publication of george lewis's "scotland: a half educated nation" in 1834 began a major debate on the suitability of the parish school system, particularly in rapidly expanding urban areas.