The economic prosperity of the 18th century was founded on agriculture. Population growth led to an increase in farming and crops spread to cover hill and mountainsides through the building of terraces and borders, and marshland was drained. Improvements such as the use of new tools and mules, as well as stabling for farm animals, made farm production profitable in the coastal districts. There was a shift away from self-sufficiency, the emphasis now being on selling products. The vine became the most important crop, with wines and spirits being produced for export.