The most famous residents of the Sorø Abbey have included the Danish historian, theologian and author Saxo Grammaticus (c. 1150 – c. 1220) ("Saxo the Literate", or "Saxo the Learned", literally "Saxo the Grammarian", a.k.a. "Saxo cognomine Longus"), who was born around the time when Skjalm Hvide's sons and Asser Rig – the founders of the Sorø Abbey – are believed to have died (both in c. 1151). "Saxo the Tall" (Danish: "Lange"), as he was called at Sorø, only later became called "Grammaticus", as a result of his excellently written Latin. Saxo's skill as a Latinist was praised by Erasmus, who wondered how ""a Dane of that age got so great power of eloquence"." Based on Saxo's writings, he is believed to have been either a clerk or secretary to Archbishop Absalon, the son of Asser Rig and grandson of Skjalm Hvide. On the invitation from Absalon, Saxo Grammaticus wrote Gesta Danorum ("Deeds of the Danes") at the Sorø Abbey. It is a patriotic work describing Danish and – to some degree – other Nordic and Baltic history, from prehistory to the late 12th century. It consists of sixteen books written in Latin. It is the most ambitious literary undertaking of medieval Denmark and an essential source for the nation's early history, and also one of the oldest known written documents about the history of Estonia and Latvia. Additionally, Gesta Danorum offers singular reflections on European affairs in the High Middle Ages, from a unique Scandinavian perspective. From Gesta Danorum, the legend of Amleth came to inspire the story of "Hamlet" by Shakespeare ("The Tragedy of Hamlet, Prince of Denmark"). Saxo is thought to have started writing Gesta Danorum in c. 1185. His writings reveal that he was in the retinue – and received the patronage – of Absalon, who was the foremost adviser to King Valdemar I. In his will, Absalon forgives his clerk Saxo a small debt of two and a half silver marks, and instructs Saxo to return two borrowed books to the monastery of Sorø. Saxo is believed to have finished Gesta Danorum by writing the preface for it as the work's last step, in c. 1216, while then being under the patronage of Anders Sunesen, who became the Archbishop of Lund after the death of Absalon in 1201.