more fixes for best-K and bug in our algo as well