had grown to 100,000. The Hafsids also had a large stake in trans-Saharan trade through the caravan routes from Tunis to Timbuktu and from Tripoli to sub-Saharan Africa. The Tunisian population was also becoming more literate - Kairouan, Tunis and Bijaya had become homes to famous university mosques, with Kairouan becoming the center of the Maliki school of religious doctrine. Science Tunis became the capital of Ifriqiya under Almohad and Hafsid rule. This shift from Kairouan to Tunis improved the position of Al-Zaytuna Mosque and helped the Ez-Zitouna University to flourish and to become one of the major centres of Islamic learning. During that period, scientists contributed to advancing knowledge in different fields. Ibn Khaldun was one of the most prominent philosopher on the Hafsid times. He received classical Islamic education in Ez-Zitouna University. With the help of the philosopher Al-Abili, Ibn Khaldun was introduced to mathematics, logic and philosophy. Architecture The Hafsids were significant builders, particularly under the reigns of successful leaders like Abu Zakariya (r. 1229–1249) and Abu Faris (r. 1394–1434), though not many of their monuments have survived intact to the present-day. While Kairouan remained an important religious center, Tunis was the capital and progressively replaced it as the main city of the region and the main center of architectural patronage. Unlike the architecture further west, Hafsid architecture was built primarily in stone (rather than brick or mudbrick) and appears to have featured much less decoration. In reviewing the history of architecture in the western Islamic world, scholar Jonathan Bloom remarks that Hafsid architecture seems to have "largely charted a course independent of the developments elsewhere in the Maghrib [North Africa]". The Kasbah Mosque of Tunis was one of the first works of this period, built by Abu Zakariya (the first independent Hafsid ruler) at the beginning of his reign. Its floor plan had noticeable differences from previous Almohad-period mosques but the minaret, completed in 1233, bears very strong resemblance the minaret of the earlier Almohad Kasbah Mosque in Marrakesh. Other foundations from the Hafsid period in Tunis include the Haliq Mosque (13th century) and the al-Hawa Mosque (1375). The Bardo Palace (today a national museum) was also begun by the Hafsids in the 15th century, and is mentioned in historical records for the first time during the reign of Abu Faris. The Hafsids also made significant renovations to the much older Great Mosque of Kairouan –