dp updated to find all subsets