working on the matrix