The history of education in Scotland in its modern sense of organised and institutional learning, began in the Middle Ages, when Church choir schools and grammar schools began educating boys. By the end of the 15th century schools were also being organised for girls and universities were founded at St Andrews, Glasgow and Aberdeen. Education was encouraged by the Education Act 1496, which made it compulsory for the sons of barons and freeholders of substance to attend the grammar schools, which in turn helped increase literacy among the upper classes.