function [bb,b0] = backprop_sym (eN, weights, dFa, N,lambda,xx,x0)
  % backward pass

  bb=cell(N,1);
  % feedforward loop
  bb{N,1}=eN;% 
  for i = N-1:-1:1
    w = weights{i+1,1};   
    bb{i,1}=w'*(dFa{i+1,1}.*bb{i+1,1})-lambda*(xx{i,1});
  end
    w = weights{1,1};   
    b0=w'*(dFa{1,1}.*bb{1,1})-lambda*(x0);
end
