Added a function to generate combinations from the elements of a list