bug hunting still problems with the alg