function out01=SinglePhotonizer(inN)
%% generates a photonstream with max photons 1 per count from multiple
%% counting streams through assuming identical distributed arrivaltimes
maxN=max(max(inN));
out01=zeros(maxN*length(inN),2);


% length(inN)
% length(out01)
% inN=a;
% i=5
% maxN=max(max(a));
% out01=zeros(maxN*length(a),2);



k=1;

for i=1:length(inN)

    if inN(i,1:2)==[0 0];
    k=k+maxN  ; 
 
    else
     photonsupplyD(:,1)=[ones(1,inN(i,1)),zeros(1,maxN-inN(i,1))];
     out01(k:k+maxN-1,1)=photonsupplyD(randperm(maxN))';
     
     photonsupplyA(:,1)=[ones(1,inN(i,2)),zeros(1,maxN-inN(i,2))];
     out01(k:k+maxN-1,2)=photonsupplyA(randperm(maxN))';
     k=k+maxN;
   end
  
end