subsets2 reimpl