function MoreIntz = sortin(Photons, IntzBefore, ER0, ER1, ER2)

total_rows = uint32(size(IntzBefore,1));
MoreIntz(1:total_rows+100,12)=zeros;
MoreIntz(1:end,1:2) = Photons;
MoreIntz(50:total_rows+49,3:4) = IntzBefore(1:total_rows,1:2);
MoreIntz(125:total_rows-26,5:6) = ER0(1:end,2:3);
MoreIntz(250:total_rows-151,7:8) = IntzBefore(1:total_rows-400,3:4);
MoreIntz(375:total_rows-276,9:10) = ER1(1:end,2:3);
MoreIntz(500:total_rows-401,11:12) = IntzBefore(1:total_rows-900,5:6);
MoreIntz(1000:total_rows-901,13:14) = ER2(1:end,2:3);