adding separate method for nearest neighbor over knearest neighbors