I have this code for sorting list of even number of items:

```
sort [] = []
sort l = sortN l (length l)
sortN l 0 = l
sortN l n = sortN (swap l) (n - 1)
swap [] = []
swap (a:b:t) | a <= b = a : b : (swap t)
swap (a:b:t) | b < a = b : a : (swap t)
```

and I am stuck. For some reason, which I don't understand it returns results as if only one swap was always called.

Also, please do not post here better and more efficient ways how to sort. I am aware of them. I want to know why this is wrong, not other solutions.

Thank you.