function [fval,x_new,iter] = pro_gra_log( A, b, nmA, lambda, tol, maxiter, epsilon)

fprintf('\n Start proximal gradient algorithm\n')

% set matrix handles
Ahandle = @(x) A*x;
AThandle = @(x) A'*x;

% initialization
[~, n] = size(A);
L = nmA;

x_old = zeros(n, 1);
x_new = x_old;

iter = 0;

while iter < maxiter
    
    % gradient of log function
    tmp = lambda * x_new./(epsilon*(epsilon + abs(x_new)));
    
    % proximal gradient
    y_tmp = x_new - (1/L)*(AThandle(Ahandle(x_new)-b) - tmp);
    x_old = x_new;
    x_new = soft_thresh(y_tmp,lambda/L/epsilon);
    
    % check for termination
    if (norm(x_new - x_old)/max(1,norm(x_new)) < tol || iter == maxiter-1)
        iter = iter + 1;
        z = Ahandle(x_new) - b;
        fval = 1/2*norm(z)^(2) + lambda*sum(log(1+abs(x_new)/epsilon));
        break
    end
    
    iter = iter + 1;
end
    
