Use of the era name was formally adopted during the reign of Emperor Wu of Han ("r". 141–87 BC), yet its origins can be traced back further. The oldest method of recording years—which had existed since the Shang—set the first year of a ruler's reign as year one. When an emperor died, the first year of a new reign period would begin. This system was changed by the 4th century BC when the first year of a new reign period did not begin until the first day of the lunar New Year following a ruler's death. When Duke Huiwen of Qin assumed the title of king in 324 BC, he changed the year count of his reign back to the first year. For his newly adopted calendar established in 163 BC, Emperor Wen of Han ("r". 180–157 BC) also set the year count of his reign back to the beginning.