What was a problem in the 1790s that was resolved by the invention of the cotton gin?

Cotton crops were being infested with insects.
Cotton had seeds that were difficult to remove from the fibers.
Prairie grasses and soils clumped up when fields were being cleared.
Soil could be ill-suited for cotton crops.