how did triangular trade work during the seventeenth and eighteenth centuries?