docs for coding the matrix