Implemented nearest neighbor district search