add proper output selection to KNN search