function [p,N] = hw2bfn(initialguess,tol)

   p0 = initialguess;
   p1 = hw2afn(p0);
   N = 1;
   while abs(p1-p0) > tol
      p0 = p1;
      p1 = hw2afn(p1);
      N = N+1;
   end
   p = p1;

end
