function [F, X]=funcs1(~,R,X0,M,T)
        
k2 = 1.2387;
k5=k2;

% [k1]=bindingconst(t);%update k1 and k6 for each T
k1 = 0.9;
k6=k1;
[L,~]=lengthvar(R,X0,T,M);
X=X0-L;%update X for each L as L updates for each T
[gx, gpx, fpx] = bindingfuncs(X);%updates gx,gpx and fpx
%as gx,gpx and fpx update fpr each X...F updates...hopefully...
n1=R(1:M);
n2=R( (M+1):(2*M));
 n3=R( (2*M+1):(3*M));
 n4=R( (3*M+1):(4*M));
        
        
        
%         F=[-1*k1*n1+k2*n2+gx.*n4 k1*n1-((k2+fpx).*n2)+gpx.*n3 fpx.*n2-((k5+gpx).*n3)+k6*n4 k5*n3-((k6+gx).*n4)];
F=[-1*k1*n1+k2*n2+gx'.*n4;k1*n1-((k2+fpx)'.*n2)+gpx'.*n3;fpx'.*n2-((k5+gpx)'.*n3)+k6*n4;k5*n3-((k6+gx)'.*n4)];