Added private method to find adjacent pairs.