King Sūtra relates how a heterodox (i.e. non-Buddhist) master instructed Prince Kalmāṣapāda (斑足王) to offer the heads of a thousand kings to Mahākāla, the "great black god of the graveyard" (), if he wished to ascend the throne of his kingdom. As time went by, Mahākāla also became seen as a guardian of Buddhist monasteries, especially its kitchens. The monk Yijing, who traveled to Srivijaya and India during the late 7th century, claimed that images of Mahākāla were to be found in the kitchens and porches of Indian Buddhist monasteries, before which offerings of food were made: Yijing then relates an anecdote about how the deity once miraculously provided food for five hundred monks who came to visit the monastery of Makuṭabandhana in Kushinagar after one of the female servants prayed and made offerings before his image. This idea of Mahākāla as one who brought prosperity to monasteries and granted wishes may have contributed to the identification of the deity as a god of wealth and fortune in Japan. In China, the god was also associated with fertility and sexuality: during the Qixi Festival (a.k.a. the Double Seventh Festival) held on the 7th day of the 7th month of the Chinese calendar, married women traditionally bought dolls or figurines called 'Móhéluó' () or 'Móhóuluó' () - the term probably deriving from 'Mahākāla' - in the hopes of giving birth to a child. Ritual texts also prescribe the worship of Mahākāla to women looking for a male partner or to pregnant women. Transformation in Japan Upon being introduced to Japan via the esoteric Tendai and Shingon sects, Mahākāla (as 'Daikokuten') gradually transformed into a jovial, beneficent figure as his positive qualities (such as being the purveyor of wealth and fertility) increasingly came to the fore - mostly at the expense of his darker traits. Whereas earlier images of Daikokuten showed him as wrathful (or at least stern-faced), later artworks consistently came to portray him as smiling. Saichō, the founder of the Tendai school, is credited with bringing the cult of Mahākāla-Daikokuten to Japan. Legend claims that when he first climbed Mount Hiei (located northeast of Kyoto), Mahākāla appeared to him in the form of an old man and offered to become the guardian of the monastic community envisioned by Saichō, what would become known as Enryaku-ji. By the medieval period, when Buddhism and native Japanese beliefs (Shinto) were becoming syncretized, Daikokuten