In the 1990s, Lithuania benefited from its adherence to strict fiscal and monetary policies, as it followed a program of privatization and increased foreign investment. The country also benefited from joining the European Union (2004), but it subsequently was among the nations hardest hit by the 2008–9 global recession, and the government instituted both a stimulus plan and an austerity budget. Dairy farming and stock raising are carried on extensively, and grains, potatoes, sugar beets, flax, and vegetables are grown. Primarily agricultural before 1940, Lithuania has since developed considerable industry, including food processing, shipbuilding, petroleum refining, and the manufacture of machinery and machine tools, metal products, major appliances, electronic components, motors, textiles, and electrical equipment. Minerals, textiles and clothing, machinery, chemicals, wood and wood products, and foodstuffs are exported, while mineral products, machinery, transportation equipment, chemicals, clothing, and metals are imported. Russia, Germany, Poland, and Latvia are the main trading partners.