Indian influence has been immense on the Newar culture and society. The oldest attested dynasty of the valley was the Licchavi dynasty ( A . D . 464 to the ninth century) under which Indianized civilization developed with Buddhism and Hinduism, elaborate architecture, and Indic arts and crafts. Although the Licchavi rulers claimed an Indian origin and all the inscriptions of this period were in Sanskrit, the existence of non-Sanskrit words indicates that the bulk of the population consisted of people who later became the Newars. In the following transitional period, esoteric Vajrayana Buddhism with its monastic institution flourished and many new ritual elements were introduced. The Newar culture grew more distinct and full-fledged during the Malla period (1200-1769). In this period, Muslims conquered north India and caused many Hindus and Buddhists to flee to Nepal. With the help of Indian Brahmans, King Sthitimalla (1382-1395) is said to have codified the caste system and encouraged social stability. Nepalese Buddhism lost its source of inspiration in India, became more ritualized, lost celibate monks, and accepted the caste norms. Influence from Tibet increased around the century, but the trend toward Hinduization was stronger. Written Newari was used in the translation of religious texts and the writing of chronicles and literature of various genres. After Yaksamalla (1428-1482), who expanded the territory and supported the valley culture by donations and construction, the kingdom was eventually divided into the three small kingdoms of Kathmandu, Lalitpur, and Bhaktapur, which frequently quarreled with each other. This situation favored the Gorkhas to the west, a politically powerful group whose core consisted of Nepali-speaking high castes. They conquered the Kathmandu Valley in 1769 and established the present Shah dynasty. Under the Ranas (1846-1951), who set aside the Shah kings and monopolized power, the Newar culture was repressed. Unlike the former immigrants, the Gorkhas did not merge with the Newars. This led to the strengthening of Newari identity. Although Nepalization has been proceeding, many Newars still retain their culture and language.