Computing MatrixA