subsetVariations with recursion