special cases of subset generating. Needs some optimization