One of the first priorities of Napoleon III was the modernisation of the French economy, which had fallen far behind that of the United Kingdom and some of the German states. Political economics had long been a passion of the Emperor. While in Britain, he had visited factories and railway yards; in prison, he had studied and written about the sugar industry and policies to reduce poverty. He wanted the government to play an active, not a passive, role in the economy. In 1839, he had written: "Government is not a necessary evil, as some people claim; it is instead the benevolent motor for the whole social organism." He did not advocate the government getting directly involved in industry. Instead, the government took a very active role in building the infrastructure for economic growth; stimulating the stock market and investment banks to provide credit; building railways, ports, canals and roads; and providing training and education. He also opened up French markets to foreign goods, such as railway tracks from England, forcing French industry to become more efficient and more competitive.