function [ok,x0,lambda]=nlsolve_sing(text,bigcount,lambda,x0_prev,dyx_prev,xstart)
%
lambda_min=1e-6;
%
disp(['nlsolve: ',text]);
if bigcount == 0
    ok=0;
    disp('nlsolve: Jacobian singular - choose better initial guess');
    x0=xstart;
else
    ok=1;
    lambda=lambda/2;
    if lambda < lambda_min
        error(['nlsolve: lambda < lambda_min = ',num2str(lambda_min)]);
    end;
    x0=x0_prev-lambda*dyx_prev;
end;