Modified method for getting subsets. Need to change Set into ArrayList.