finished AB algo, should be done