Generates subsets using bitmask