function [zetSS, PGSS, YGSS, KBSS, KGSS, HBSS, HGSS, HSS, KSS, ISS, CSS, WSS, YSS, PBSS]=steadystate_helper2(RBSS, RGSS, YBSS, PiISS, ASS, xi, alf, del, g, phi, sig)
%x0=[1/2; 1/3; 1/4; 1/5; 1/6; 1/7; 1/8; 2/3; 3/4; 4/5; 5/6; 6/7; 7/8; 8/9];
%x0=[2; 1/3; 1/4; 2; 1/6; 7; 1; 2/3; 3/4; 4/5; 5; 6/7; 3; 2];
x0=[0.45; 0.42; 0.27; 0.044; 0.037; 0.87; 0.73; 1.6; 0.08; 0.002; 0.25; 0.1; 0.36; 0.42];

F=@(zet, PG, YG, KB, KG, HB, HG, H, K, I, C, W, Y, PB) [
    zet-(YBSS/(((PB/PiISS)^(-xi))*Y));
    PG-(((1-zet)^(1-zet))*(zet^zet)*PiISS*(PB^(-zet)))^(1/(1-zet));
    YG-(1-zet)*((PG/PiISS)^(-zet))*Y;
    KB-(alf*PB*YBSS/RBSS);
    KG-(alf*PG*YG/RGSS);
    HB-(YBSS/(ASS*(KB^alf)))^(1/(1-alf));
    HG-(YG/(ASS*(KG^alf)))^(1/(1-alf));
    K-KG-KB;
    I-(del*K);
    W-(1-alf)*(PG*YG/HG);
    H-HB-HG;
    C-(Y-I-g*Y);
    W-(1-alf)*PB*(YBSS/HB);
    1-(W/((C^sig)*(H^phi)));
    ]
    
fcn = @(b) F(b(1),b(2),b(3),b(4),b(5),b(6),b(7),b(8),b(9),b(10),b(11),b(12),b(13),b(14));
options = optimset ('Display', 'Final', 'Tolx', 1e-10,'Tolfun',1e-10);

B=fsolve(fcn, x0, options);
zetSS=B(1);
PGSS=B(2);
YGSS=B(3);
KBSS=B(4);
KGSS=B(5);
HBSS=B(6);
HGSS=B(7);
HSS=B(8);
KSS=B(9);
ISS=B(10);
CSS=B(11);
WSS=B(12);
YSS=B(13);
PBSS=B(14);
