I am not too proficient with functional style and I don't want to use any **set** functions, so I have a problem. I am really struggling whether I should do recursively or in a different manner.

I have a collection of pairs in a list, like so:

```
((4 2) (3 1) (3 2) (2 4) etc...)

```

In this pair '(4 2), the second element '2' tells me which other pairs it **matches** to, in this case '(3 2).
So, I add these two pairs together using their first element, in this case, it's '4' and '3'.
The new pair is now '(7 2). And so on for **other pairs in the list** too.
Finally, it should return:

```
 ((7 2) (3 1) (2 4))

```

I would care less about the order.
.
I already have a working function that add two different pairs. The only assumption with this function is that the pairs are matching.

Consequently, what I want to do is manipulated this list of pairs to return a list in these manners.

Examples:

```
 take the list ((4 2) (3 1) (3 2) (2 4))    
 matching-pairs: '(4 2) and '(3 2)

 and then return --> ((7 2) (3 1) (2 4))

 take the list ((2 1) (3 2) (1 2) (5 1) (6 3))
 matching-pairs: '(2 1) and '(5 1)
                 '(3 2) and '(1 2)

 and then return --> ((7 1) (4 2) (6 3))

```

Thank you for your time and efforts.