I am wondering why we use `swap` function here? Why not sway value directly, like 

    X.T[i], X.T[i + 1] = X.T[i + 1], X.T[i]