In the early 8th century, the Emperor Tenmu commissioned a compilation of the legends and genealogies of Japan's clans, resulting in the completion of the "Kojiki" in 712. Designed to legitimate the ruling dynasty, this text created a fixed version of various stories previously circulating in oral tradition. The "Kojiki" omits any reference to Buddhism, in part because it sought to ignore foreign influences and emphasise a narrative stressing indigenous elements of Japanese culture. Several years later, the "Nihon shoki" was written. Unlike the "Kojiki", this made various references to Buddhism, and was aimed at a foreign audience. Both of these texts sought to establish the imperial clan's descent from the sun kami Amaterasu, although there were many differences in the cosmogonic narrative they provided. Quickly, the "Nihon shoki" eclipsed the "Kojiki" in terms of its influence. Other texts written at this time also drew on oral traditions regarding the kami. The "Sendari kuji hongi" for example was probably composed by the Mononobe clan while the "Kogoshui" was probably put together for the Imibe clan, and in both cases they were designed to highlight the divine origins of these respective lineages. A government order in 713 called on each region to produce "fudoki", records of local geography, products, and stories, with the latter revealing more traditions about the kami which were present at this time.