function [acceptable_endings,acceptable_beginnings]=find_consecutive_breakpoints(possible_endings,possible_beginnings)
%description: used if only upper segments that immediately follow lower segments and only lower segments that immediately follow upper segments are allowed
    %this should permit maximum mimicry of the statistics of the original noise, as only 'full transitions' in the original noise can be the sites of recombination
    %on the other hand it may reduce the number of possible recombinations
%called by: noise_segmenter
%calls: no custom functions
%notes:
%code confirmed date: march 17, 2012, modify/reconfirm july 16, 2012

acceptable_endings=[];acceptable_beginnings=[];
for iii=1:length(possible_endings)
    if any((possible_endings(iii)+1)==possible_beginnings)
        acceptable_endings=[acceptable_endings possible_endings(iii)];
        acceptable_beginnings=[acceptable_beginnings possible_beginnings(find((possible_beginnings-1)==possible_endings(iii)))];  %seems safer than just taking possible_endings(iii)+1
    end
end