distress of not being invited to attend the Imperial Feng Sacrifice. Suspecting his time was running out, he summoned his son back home to take over the historical work he had begun. Sima Tan wanted to follow the Annals of Spring and Autumn—the first chronicle in the history of Chinese literature. It appears that Sima Tan was only able to put together an outline of the work before he died. the postface of the completed Shiji, there is a short essay on the six philosophical schools that is explicitly attributed to Sima Tan. Otherwise, there are only fragments of the Shiji that are speculated to be authored by Sima Tan or based on his notes. Fueled by his father's inspiration, Sima Qian spent much of the subsequent decade authoring and compiling the Records of the Grand Historian, completing it before 91 BC, probably around 94 BC. Three years after the death of his father, Sima Qian assumed his father's previous position as taishi. In 105 BC, Sima was among the scholars chosen to reform the calendar. As a senior imperial official, Sima was also in the position to offer counsel to the emperor on general affairs of state. The Li Ling affair In 99 BC, Sima became embroiled in the Li Ling affair, where Li Ling and Li Guangli, two military officers who led a campaign against the Xiongnu in the north, were defeated and taken captive. Emperor Wu attributed the defeat to Li Ling, with all government officials subsequently condemning him for it. Sima was the only person to defend Li Ling, who had never been his friend but whom he respected. Emperor Wu interpreted Sima's defence of Li as an attack on his brother-in-law, Li Guangli, who had also fought against the Xiongnu without much success, and sentenced Sima to death. At that time, execution could be commuted either by money or castration. Since Sima did not have enough money to atone his "crime", he chose the latter and was then thrown into prison, where he endured three years. He described his pain thus: "When you see the jailer you abjectly touch the ground with your forehead. At the mere sight of his underlings you are seized with terror ... Such ignominy can never be wiped away." Sima called his castration "the worst of all punishments". In 96 BC, on his release from prison, Sima chose to live