I have the following question "Given a list of integer pairs, write a function to return a list of even numbers in that list in sml".

this is what I've achieved so far

```
val x = [(6, 2), (3, 4), (5, 6), (7, 8), (9, 10)];

fun isEven(num : int) = 
    if num mod 2 = 0 then num else 0;

fun evenNumbers(list : (int * int) list) = 
    if null list then [] else 
    if isEven(#1 (hd list)) <> 0
    then if isEven(#2 (hd list)) <> 0
         then #1 (hd list) :: #1 (hd list) :: evenNumbers(tl list)
         else []
    else if isEven(#2 (hd list)) <> 0
         then #1 (hd list) :: evenNumbers(tl list)
         else [];

evenNumbers(x);

```

the result should be like this `[6,2,4,6,8,10]`

any help would be appreciated.