function [ys,check] = code1_steadystate(ys,exe)

global M_ lgy_ xroot0

if isfield(M_,'param_nbr') == 1
    NumberOfParameters = M_.param_nbr;
for i = 1:NumberOfParameters
    paramname = deblank(M_.param_names(i,:));
    eval([ paramname ' = M_.params(' int2str(i) ');']);
end

check = 0;

end


%% Solving for the steady state

if count == 0
    xroot0 = fsolve(@(xarg) system1(xarg,alpha, betta, gamma_ss, delta, sgma, omg, b_ss, g, n_ss, x_ss), 2.*ones(1,11));

    pi_ss = xroot0(1);
    epsilon_ss = xroot0(2);
    omega_ss = xroot0(3);
    k_ss = xroot0(4);
    y_ss = xroot0(5);
    h_ss = xroot0(6);
    c_ss = xroot0(7);
    lambda_ss = xroot0(8);
    a_ss = xroot0(9);
    tau_ss = xroot0(10);
    R_ss = xroot0(11);

    pii = pi_ss;
    epsilon = epsilon_ss;
    omega = omega_ss;
    k = k_ss;
    y = y_ss;
    h = h_ss;
    c = c_ss;
    ii = (n_ss + x_ss + delta)*k_ss;
    lambda = lambda_ss;
    a = a_ss;
    tau = tau_ss;
    R = R_ss;
    q = 1;
    count = count + 1;
    
else
    xroot = fsolve(@(xarg) system1(xarg,alpha, betta, fgamma_ss, delta, sgma, omg, fb_ss, g, fn_ss, x_ss), xroot0);

    pi_fss = xroot(1);
    epsilon_fss = xroot(2);
    omega_fss = xroot(3);
    k_fss = xroot(4);
    y_fss = xroot(5);
    h_fss = xroot(6);
    c_fss = xroot(7);
    lambda_fss = xroot(8);
    a_fss = xroot(9);
    tau_fss = xroot(10);
    R_fss = xroot(11);

    pii = pi_fss;
    epsilon = epsilon_fss;
    omega = omega_fss;
    k = k_fss;
    y = y_fss;
    h = h_fss;
    c = c_fss;
    ii = (fn_ss + x_ss + delta)*k_fss;
    lambda = lambda_fss;
    a = a_fss;
    tau = tau_fss;
    R = R_fss;
    q = 1;
    
end
    

%%


for iter = 1:length(M_.params)
  eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ])
end

if isfield(M_,'param_nbr') == 1
    
    if isfield(M_,'orig_endo_nbr') == 1
        NumberOfEndogenousVariables = M_.orig_endo_nbr;
    else
        NumberOfEndogenousVariables = M_.endo_nbr;
    end
    
    ys = zeros(NumberOfEndogenousVariables,1);
    
    for i = 1:NumberOfEndogenousVariables
        varname = deblank(M_.endo_names(i,:));
        eval(['ys(' int2str(i) ') = ' varname ';']);
    end

else
    ys=zeros(length(lgy_),1);
    
    for i = 1:length(lgy_)
        ys(i) = eval(lgy_(i,:));
    end
    
check = 0;

end
end