function [Res, FRes, FEs, tot_iter]= Newton_SOR(Func, Jacobian, X0, maxit, acc, mstep, omega)

%Starting Evaluations
accur=0.5*10^(-acc);
FEs=0;

n=length(X0);
root=X0;
stop=0;
p=0;

F0 = feval(Func, root);

Res = X0;
FRes = F0;

while (stop==0)
	p=p+1;
	%for all dimensions do
	for i=1:n
		
        % solve univariate equation
		
        [X, F, iter] = newton_raphson(root, Func, Jacobian, i, mstep, accur, accur);
		root(i) = root(i) + omega * (X(i)- root(i));
        
        FEs = FEs + iter*n; %(2*n);
    end
    
    Res = [Res ; root];
    F = feval(Func, root);
    FRes = [FRes ; F];
	   
	if ( (norm(F)<=accur) || (norm(root-X0)<=accur) || FEs >= maxit )
		stop=1;
		break;
	end
	X0=root;
end

Res = [Res ; root];
tot_iter = p;
