function [ys,params,check] = edsge_nopol_steadystate(ys,exo,M_,options_)
% Inputs: 
%   - ys        [vector] vector of initial values for the steady state of the endogenous variables
%   - exo       [vector] vector of values for the exogenous variables
%   - M_        [structure] Dynare model structure
%   - options   [structure] Dynare options structure
%
% Output: 
%   - ys        [vector] vector of steady state values for the the endogenous variables
%   - params    [vector] vector of parameter values
%   - check     [scalar] 0 if steady state computation worked and to
%                        1 of not (allows to impose restrictions on parameters)

for ii = 1:M_.param_nbr
  eval([ M_.param_names{ii} ' = M_.params(' int2str(ii) ');']);
end
params=M_.params;

check = 0;

%%   
R = 1/betta;

options=optimset('MaxFunEvals',10000,'TolX',1e-10,'TolFun',1e-10);

Kb_Lb_g = 30;
Kg_Lg_g = 40;
Lb_g= 0.20;
Lg_g= 0.30;
emis_g = 0.5;

guess = [Kb_Lb_g,Kg_Lg_g,Lb_g,Lg_g,emis_g]; 
ss_sol = fsolve(@(x)findss_nopol(x,alfab, alfag, deltab, deltag, omega, ksi, rhoL, deltax, R, Abar, erow, rhoy, alfayb, alfayg, d0,d1,d2),guess,options);

Kb_Lb = ss_sol(1);
Kg_Lg = ss_sol(2);
Lb = ss_sol(3);
Lg = ss_sol(4);
emis =ss_sol(5);

Rkb=1/betta;
Rkg= Rkb;
Kb = Kb_Lb*Lb;
Kg = Kg_Lg*Lg;
X = (emis+erow)/(1-deltax);
dX = d2*(X)^2+d1*(X)+d0;
Yb = (1-dX)*Abar* Kb^(alfab)*Lb^(1-alfab);
Yg = (1-dX)*Abar*(Kg^(alfag)*Lg^(1-alfag));
Y = ((alfayb^(1/rhoy))*Yb^((rhoy-1)/rhoy)+(alfayg^(1/rhoy))*Yg^((rhoy-1)/rhoy))^(rhoy/(rhoy-1));
pg=(alfayg*Y/Yg)^(1/rhoy);
pb=(alfayb*Y/Yb)^(1/rhoy);
Ig = deltag*Kg;
Ib = deltab*Kb;
Qg = 1;
Qb = 1;
I = Ig+Ib;
C= Y-I;
L = (Lb^(1+rhoL) + Lg^(1+rhoL))^(1/(1+rhoL));
wb = (1-alfab)*pb*(1-dX)*Abar*(Kb^alfab)*(Lb^(-alfab));
wg = (1-alfag)*pg*(1-dX)*Abar*(Kg^alfag)*(Lg^(-alfag));

M = betta;
sg = (Qg*Kg)/(Qg*Kg+Qb*Kb);
spreadb = Rkb-R;
spreadg = Rkg-R;
A = Abar;
eA = 0;

    
params=NaN(M_.param_nbr,1);
for iter = 1:M_.param_nbr %update parameters set in the file
  eval([ 'params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
end

for ii = 1:M_.orig_endo_nbr %auxiliary variables are set automatically
  eval(['ys(' int2str(ii) ') = ' M_.endo_names{ii} ';']);
end