global flip;
global iteration;
global Hin_ToFlip;
global IPTG;
global Xylose;
global Arabinose;

iteration=0;
flip=0; % Hin is from left to right
Hin_ToFlip=60; % Assumed that at 60 nM Hin flips DNs segments



IPTG=1000;
Xylose=1000;
Arabinose=1000;
tspan=[0 5000]; % Simulate for 3000 sec
[plott ploty]=ode15s(@StochasticSwitch,tspan,StochasticSwitch_initial_values);
plot(plott,ploty)
legend ('mRNA_LacI','LacI','IPTG_LacI','mRNA_XylR','XylR','Xylose_XylR','mRNA_Rfp','Rfp','mRNA_Gfp','Gfp','mRNA_Hin_RightToLeft','Hin','mRNA_Hin_LeftToRight','mRNA_AraR','AraR','Arabinose_AraR','mRNA_SspB','SspB','SspB_Hin')