Nalanda was one of the first residential universities, i.e. it had dorms. During its days it was a flourishing residential university with over 10,000 students and 1500 teachers. The university was marked by a lofty wall and one gate. The library was located in a nine storied building. The subjects taught at Nalanda University covered every field of learning. The Tang Dynasty Chinese pilgrim Xuanzang left detailed accounts of the university in the 7th century.