Add a function to find close ids