Added tsqr function