finish ball tree query