if first == 1  % !!! initialize this to 1 before running for first time !!!
  array = read_asc(fname);
  badones = [];
  [a, ph, res, ind] = btcal(array, label, badones);
  first = 0;
else
  badones = worst(res, ind, badones);
  [a, ph, res, ind] = btcal(array, label, badones);
end

