Updated to use random subsets.