
function Y = MPCoord_sseqs(x0,taxes)
  Cc  = x0(1);  %(long_name='Consumption center')
  Ca  = x0(2);  %(long_name='Consumption emergent country 1(incumbent)')
  Cb  = x0(3);  %(long_name='Consumption emergent country 2(entrant)')

  Hc  = x0(4);  %(long_name='(Labor) Hours worked in center')
  Ha  = x0(5);  %(long_name='(Labor) Hours worked in emergent country 1')
  Hb  = x0(6);  %(long_name='(Labor) Hours worked in emergent country 2')

  % Firm related variables
  Yc  = x0(7);  %(long_name='Output-Center')
  Ya  = x0(8);  %(long_name='Output-Emergent country 1')
  Yb  = x0(9);  %(long_name='Output-Emergent country 2')

  Kc  = x0(10);  %(long_name='Capital-Center')
  Ka  = x0(11);  %(long_name='Capital-Emergent country 1')
  Kb  = x0(12);  %(long_name='Capital-Emergent country 2')

  % factor remunerations
  %rc  = x0(13);  %(long_name='rate of return of capital-Center')
  %ra  = x0(14);  %(long_name='rate of return of capital-Emergent country 1')
  %rb  = x0(15);  %(long_name='rate of return of capital-Emergent country 2')

  %Wc  = x0(16);  %(long_name='Wage-Center')
  %Wa  = x0(17);  %(long_name='Wage-Emergent country 1')
  %Wb  = x0(18);  %(long_name='Wage-Emergent country 2')

  Rkc  = x0(13);  %(long_name='Gross rate of return of capital-Center')
  Rka  = x0(14);  %(long_name='Gross rate of return of capital-Emergent country 1')
  Rkb  = x0(15);  %(long_name='Gross rate of return of capital-Emergent country 2')

  %Balance Sheet variables
  Nc  = x0(16);  %(long_name='Net worth of rep. bank-Center')
  Na  = x0(17);  %(long_name='Net worth of rep. bank-Emergent country 1')
  Nb  = x0(18);  %(long_name='Net worth of rep. bank-Emergent country 2')

  Fa  = x0(19);  %(long_name='Foreign Lending-Emergent country 1')
  Fb  = x0(20);  %(long_name='Foreign Lending-Emergent country 2')

  % Deposits // (EME Deposits will be set as D=V*(psi-1)
  Dc  = x0(21);  %(long_name='Deposits-Center')
  %Da  = x0(28);  %(long_name='Deposits-EME1')
  %Db  = x0(29);  %(long_name='Deposits-EME2')

  Rdc = x0(22);  %(long_name='Deposits Rate-Center')
  Rda = x0(23);  %(long_name='Deposits Rate-EME1')
  Rdb = x0(24);  %(long_name='Deposits Rate-EME2')

  Rba  = x0(25);  %(long_name='Foreign Loans rate-Emergent country 1')
  Rbb  = x0(26);  %(long_name='Foreign Loans rate-Emergent country 2')

  jc  = x0(27);  %(long_name='Derivative of value function of banks J-Center')
  ja  = x0(28);  %(long_name='Derivative of value function of banks J-Emergent country 1')
  jb  = x0(29);  %(long_name='Derivative of value function of banks J-Emergent country 2')

  muc  = x0(30);  %(long_name='Lagrange multiplier of ICC-Center')
  mua  = x0(31);  %(long_name='Lagrange multiplier of ICC-Emergent country 1')
  mub  = x0(32);  %(long_name='Lagrange multiplier of ICC-Emergent country 2')

  %Tc  = x0(41);  %(long_name='Lump sum tax-Center')
  %Ta  = x0(42);  %(long_name='Lump sum tax-Emergent country 1')
  %Tb  = x0(43);  %(long_name='Lump sum tax-Emergent country 2')


%Parameters
nc = 0.5;
na = 0.25;
nb = 0.25;
betta = 0.99;
thetta = 0.95;
sigmma  = 1.02;
pssi = 0.276;
alphha = 0.333;
delta = 0.025;

zetta = 3.456;
eta  = 0.0025;
etaD = 0.0025;

deltaT = 0.003;
psiDa = 1.;
psiDb = 1;

kappac = 0.38;
kappaa = 0.38;
kappab = 0.38;
kappafa = 0.38;
kappafb = 0.38;

rhoA = 0.85;
rhok = 0.85;
stdepsA = 0.007;
stdxik = 0.005;

phih = 0.85465*0;

%Model Equations (SS)

%%Known SS values:
%From eqs 1-3 (EulerEqs) - %%R wont enter here as variable to solve for.
R = 1/betta;
%Ra = 1/betta;
%Rb = 1/betta;

Bc = 0;
Ba = 0;
Bb = 0;

%Policy Tools SS value (now an argument from planning perspective)
if nargin == 1 
  tauc = -0.16;
  taua = -0.20;
  taub = -0.20;
else
  tauc = taxes(1);
  taua = taxes(2);
  taub = taxes(3);
end



%%Eqs to solve: (SSeqs defined as -LHS+RHS of the original static equation of the model)
ss1 = -betta*Rdc + 1; %EEqs for Deposits
ss2 = -betta*Rda + 1;
ss3 = -betta*Rdb + 1;

ss4 = Hc^(pssi) - Cc^(-sigmma)*(1-alphha)*Kc^(alphha)*Hc^(-alphha);
ss5 = Ha^(pssi) - Ca^(-sigmma)*(1-alphha)*Ka^(alphha)*Ha^(-alphha);
ss6 = Hb^(pssi) - Cb^(-sigmma)*(1-alphha)*Kb^(alphha)*Hb^(-alphha);

%With consumption habits: (comment to disable)

%lambdac = ((Cc - phih*Cc(-1))^(-sigmma) - betta*phih*(Cc(+1) - phih*Cc)^(-sigmma))
%lambdac = (1 - betta*phih)*((1 - phih)*Cc)^(-sigmma)

%ss4 = Hc^(pssi) - (1 - betta*phih)*((1 - phih)*Cc)^(-sigmma)*(1-alphha)*Kc^(alphha)*Hc^(-alphha);
%ss5 = Ha^(pssi) - (1 - betta*phih)*((1 - phih)*Ca)^(-sigmma)*(1-alphha)*Ka^(alphha)*Ha^(-alphha);
%ss6 = Hb^(pssi) - (1 - betta*phih)*((1 - phih)*Cb)^(-sigmma)*(1-alphha)*Kb^(alphha)*Hb^(-alphha);

%Cc = (Rc-1)*Bc + (Rdc-1)*Dc + Wc*Hc + ((1-thetta)*Rkc - deltaT)*Kc + (1-thetta)*(Rba*Fa + Rbb*Fb - Rdc*Dc) - Tc;
ss7 = -Ca + (Rda-1)*(psiDa-1)*Fa + (1-alphha)*Ka^(alphha)*Ha^(-alphha)*Ha + ((1-thetta)*Rka - deltaT)*Ka - (1-thetta)*(((Rba-Rda)+psiDa*Rda)*Fa) + taua*alphha*Ha^(1-alphha)*Ka^(alphha-1)*Ka; 
ss8 = -Cb + (Rdb-1)*(psiDb-1)*Fb + (1-alphha)*Kb^(alphha)*Hb^(-alphha)*Hb + ((1-thetta)*Rkb - deltaT)*Kb - (1-thetta)*(((Rbb-Rdb)+psiDb*Rdb)*Fb) + taub*alphha*Hb^(1-alphha)*Kb^(alphha-1)*Kb;

%ss9  = -rc + alphha*Hc^(1-alphha)*Kc^(alphha-1);
%ss10 = -ra + alphha*Ha^(1-alphha)*Ka^(alphha-1);
%ss11 = -rb + alphha*Hb^(1-alphha)*Kb^(alphha-1);

%ss9  = -Wc + (1-alphha)*Kc^alphha*Hc^(-alphha);
%ss10 = -Wa + (1-alphha)*Ka^alphha*Ha^(-alphha);
%ss11 = -Wb + (1-alphha)*Kb^alphha*Hb^(-alphha);

%ss15 = tauc*rc*Kc + Tc;
%ss16 = taua*ra*Ka + Ta;
%ss17 = taub*rb*Kb + Tb;

ss9  = -Rkc + (1-tauc)*alphha*Hc^(1-alphha)*Kc^(alphha-1) + 1-delta;
ss10 = -Rka + (1-taua)*alphha*Ha^(1-alphha)*Ka^(alphha-1) + 1-delta;
ss11 = -Rkb + (1-taub)*alphha*Hb^(1-alphha)*Kb^(alphha-1) + 1-delta;

%Banking system
%local firms assets intermediation
ss12 = -betta*(1-thetta+thetta*jc)*(Rkc-Rdc) + muc*kappac;
ss13 = -betta*(1-thetta+thetta*ja)*(Rka-(Rba-Rda+psiDa*Rda)/psiDa) + mua*kappaa;
ss14 = -betta*(1-thetta+thetta*jb)*(Rkb-(Rbb-Rdb+psiDb*Rdb)/psiDb) + mub*kappab;

%foreign lending intermediation
ss15 = -betta*(1-thetta+thetta*jc)*(Rba-Rdc) + muc*kappafa;
ss16 = -betta*(1-thetta+thetta*jc)*(Rbb-Rdc) + muc*kappafb;

%envelope condition wrt net worth
ss17 = -jc*(1-muc) + betta*(1-thetta+thetta*jc)*Rdc;
ss18 = -ja*(1-mua) + betta*(1-thetta+thetta*ja)*(Rba-Rda+psiDa*Rda)/psiDa;
ss19 = -jb*(1-mub) + betta*(1-thetta+thetta*jb)*(Rbb-Rdb+psiDb*Rdb)/psiDb;

%net worth
ss20 = -Nc + thetta*(Rkc*Kc + Rba*Fa + Rbb*Fb - Rdc*Dc) + deltaT*Kc;
ss21 = -Na + thetta*(Rka*Ka - (Rba-Rda+psiDa*Rda)*Fa) + deltaT*Ka;
ss22 = -Nb + thetta*(Rkb*Kb - (Rbb-Rdb+psiDb*Rdb)*Fb) + deltaT*Kb;

%ICCs
% ICCt1 (GK2011)
  ss23 = -jc*Nc + kappac*Kc + kappafa*Fa + kappafb*Fb;
  ss24 = -ja*Na + kappaa*Ka;
  ss25 = -jb*Nb + kappab*Kb;
% ICCt2 (stricter)
%TBA

%balance sheet of banks
ss26 = -Kc - Fa - Fb + Nc + Dc;
ss27 = -Ka + Na + psiDa*Fa;
ss28 = -Kb + Nb + psiDb*Fb;


%Deposits in EMEs
%ss38 = Da - (psiDa-1)*Fa;
%ss39 = Db - (psiDb-1)*Fb;

%Other MC Conds:
%Output
ss29 = -Yc + Hc^(1-alphha)*Kc^(alphha);
ss30 = -Ya + Ha^(1-alphha)*Ka^(alphha);
ss31 = -Yb + Hb^(1-alphha)*Kb^(alphha);

%Final Good World Aggregate
%ss40 = -Yc - Yi - Ye + Cc + Ci + Ce + delta*Kc + delta*Ki + delta*Ke;
ss32 = -nc*Yc - na*Ya - nb*Yb + nc*Cc + na*Ca + nb*Cb + nc*delta*Kc + na*delta*Ka + nb*delta*Kb ; %+ nc*(eta/2)*Dc^2
%ss40 = -Cc + (Rc-1)*Dc + Wc*Hc + ((1-thetta)*Rkc - deltaT)*Kc + (1-thetta)*(Rbi*Vi + Rbe*Ve - Rc*Dc) - Tc;

Y = [ss1,ss2,ss3,ss4,ss5,ss6,ss7,ss8,ss9,ss10,ss11,ss12,ss13,ss14,ss15,ss16,ss17,ss18,ss19,ss20,ss21,ss22,ss23,ss24, ...
ss25,ss26,ss27,ss28,ss29,ss30,ss31,ss32];

end
