The code worked fine for me.
The code just counts from 1 to 2^n where n is the number of numbers in row
1
It then uses the binary representation of each number to pickout which
number in the original list of numbers in row 1 to include in the
combination.
It allows you to limit its output to combinations within a range of
numbers, such as combinations of subsets of size 2 to 5 in the example.
I have used this method several times in the past, so I am familiar with it
and can vouch that it works.