function for identifying intersection nodes