How did the invention of the cotton gin affect life in the south in the 1800s?