function [gov, citotal, wf, ytotal, ctotal, cftotal, c1i, c1f] = SGU_test2_steadystate_helper(gov0, citotal0, wf0, ytotal0, ctotal0, cftotal0, c1i0, c1f0,TAU,TAUNN,ZETA,VARTHETA,IOTA1,EE,NU,ALPHAF,ALPHAB,PHI,ETA,BB,theta,kappa,nnf,yi,nni,yf)
    % Initial guess for fsolve
    X0 = [gov0; citotal0; wf0; ytotal0; ctotal0; cftotal0; c1i0; c1f0];

    % Define the system of implicit equations
    F = @(X) [-X(1) + (TAU + TAUNN) * X(3) * nnf / (1 - ZETA * VARTHETA * (1 - IOTA1) / IOTA1 * (X(7) / X(8))^(EE - 1) * yi * nni^NU);
              -X(2) + (1 - X(1) * nni^NU * ZETA * VARTHETA) * yi;
              -X(3) + ALPHAB / (1 + TAUNN) * (ALPHAF * yf / nnf + kappa * theta) + (1 - ALPHAB) / (1 - TAU) * ((PHI * ETA * (nni)^(ETA - 1)) / (IOTA1 * X(8)^(EE - 1) * (IOTA1 * X(8)^EE + (1 - IOTA1) * X(7)^EE)^(-1)) + BB);
              -X(4) + yf + yi * (1 - IOTA1) / IOTA1 * (X(7) / X(8))^(EE - 1);
              -X(5) + X(2) * (1 - IOTA1) / IOTA1 * (X(7) / X(8))^(EE - 1) + X(6);
              -X(6) + 0.78204665 * yf;
              -X(7) + X(2) / 2.53;
              -X(8) + 0.7809 * X(6)];

    % Options for fsolve
    options = optimoptions('fsolve', 'Display', 'off');

    % Solve the system of equations
    [X, fval, exitflag] = fsolve(F, X0, options);

    % Check if the solution is successful
    if exitflag <= 0
        error('fsolve did not converge');
    end

    % Assign the solved values to the output variables
    gov = X(1);
    citotal = X(2);
    wf = X(3);
    ytotal = X(4);
    ctotal = X(5);
    cftotal = X(6);
    c1i = X(7);
    c1f = X(8);
end
