reading matrix is working