def bk_nearest_neighbor_search(search_string, tree):
    """
    Search tree for nearest matches to supplied string.

    Parameters
    ----------
    search_string : str
        search string
    tree : BKTree
        tree to search

    Return values
    -------------
    matches : list
        list of strings containing nearest matches from tree, where first item
        is distance from search_string to nearest matches
    """
    threshold = tree.root.distance_metric[tree.metric](search_string,
                                                       tree.root.string)
    matches_dictionary = {}
    matches_dictionary[threshold] = []
    tree.root.recursive_nn_search(search_string, threshold,
                                  matches_dictionary, tree.metric)
    matches = [sorted(matches_dictionary.keys())[0]]
    for value in matches_dictionary[matches[0]]:
        matches.append(value)

    return matches