Although these natural calamities and rebellions stained the reputation and hampered the effectiveness of the central government, the early 9th century is nonetheless viewed as a period of recovery for the Tang dynasty. The government's withdrawal from its role in managing the economy had the unintended effect of stimulating trade, as more markets with fewer bureaucratic restrictions were opened up. By 780, the old grain tax and labor service of the 7th century was replaced by a semiannual tax paid in cash, signifying the shift to a money economy boosted by the merchant class. Cities in the Jiangnan region to the south, such as Yangzhou, Suzhou, and Hangzhou prospered the most economically during the late Tang period. The government monopoly on the production of salt, weakened after the An Lushan Rebellion, was placed under the Salt Commission, which became one of the most powerful state agencies, run by capable ministers chosen as specialists. The commission began the practice of selling merchants the rights to buy monopoly salt, which they would then transport and sell in local markets. In 799 salt accounted for over half of the government's revenues.