use while loop, stop when it learns, report how many iterations it took