Create adjacentPairs

adjacent pairs function.