remove parallel in transposed matrix, and refactor some pieces of the code