a function to find neighbors