What was the economy in South Carolina based on?