minor fix, transpose the matrix