The new customs spread as the Church also acted as the state's educational system. Church run schools with Latin "trivium" (grammar, rhetoric, dialectic) and "quadrivium" (mathematics, geometry, astronomy, and music) and was helped by various religious orders which established monasteries throughout the countryside. By the end of the 13th century, over 300 monasteries existed in Poland, spreading Catholicism and Western traditions: for example, the first Benedictine monasteries built in the 11th century in Tyniec and Lubin spread new Western agricultural and industrial techniques.