function list_all_nonredundant_permutations_upto_lengthn(listofclusters,list_so_far,length_sought)
%description: as the name implies
%called by: cluster_asynch_based_on_phasic, temporary_asynch_analyzer(deprecated)
%calls: [no custom functions other than itself]
%note: recursive
%code confirmed date: sep 20, 2009

global all_permutations_of_sites_given_numclusters_sites_global

if isempty(list_so_far),nexxi=1:listofclusters(end);else nexxi=(list_so_far(end)+1):listofclusters(end);end

for next_element=nexxi
	if length(list_so_far)+1==length_sought
        all_permutations_of_sites_given_numclusters_sites_global{end+1}=[list_so_far next_element];
    else
        list_all_nonredundant_permutations_upto_lengthn(listofclusters,[list_so_far next_element],length_sought)        
    end
end