function [best] = minimize_me_harder_in_2d(fun, mul, start, xarg)

global best

best = start;
minval = feval(fun, best, xarg);

count = 0;

while minval > 1e-6,
  count = count+1;
  step = [randn*mul randn*mul];
  new = best + step;
  val = feval(fun, new, xarg);

  if val < minval,
    disp(sprintf('i=%d  value=%g', count, val));  disp(step);  disp(new);
    best = new;
    minval = val;
    mul = max(abs(step));
  end
end

disp(sprintf('%d iterations.', count));
