Added infrastructure for NNSearch