function that returns best indexes is done, but untested