later caves were each commissioned as a complete unit by a single patron from the local rulers or their court elites, again for merit in Buddhist afterlife beliefs as evidenced by inscriptions such as those in Cave 17. After the death of Harisena, smaller donors motivated by getting merit added small "shrinelets" between the caves or add statues to existing caves, and some two hundred of these "intrusive" additions were made in sculpture, with a further number of intrusive paintings, up to three hundred in cave 10 alone. Monasteries The majority of the caves are vihara halls with symmetrical square plans. To each vihara hall are attached smaller square dormitory cells cut into the walls. A vast majority of the caves were carved in the second period, wherein a shrine or sanctuary is appended at the rear of the cave, centred on a large statue of the Buddha, along with exuberantly detailed reliefs and deities near him as well as on the pillars and walls, all carved out of the natural rock. This change reflects the shift from Hinayana to Mahāyāna Buddhism. These caves are often called monasteries. The central square space of the interior of the viharas is defined by square columns forming a more-or-less square open area. Outside this are long rectangular aisles on each side, forming a kind of cloister. Along the side and rear walls are a number of small cells entered by a narrow doorway; these are roughly square, and have small niches on their back walls. Originally they had wooden doors. The centre of the rear wall has a larger shrine-room behind, containing a large Buddha statue. The viharas of the earlier period are much simpler, and lack shrines. Spink places the change to a design with a shrine to the middle of the second period, with many caves being adapted to add a shrine in mid-excavation, or after the original phase. The plan of Cave 1 shows one of the largest viharas, but is fairly typical of the later group. Many others, such as Cave 16, lack the vestibule to the shrine, which leads straight off the main hall. Cave 6 is two viharas, one above the other, connected by internal stairs, with sanctuaries on both levels. Worship halls The other type of main hall architecture is the narrower rectangular plan with high arched ceiling type chaitya-griha – literally, "the house of stupa".