can i have a general algorithm so that the user is able to choose how many set?