change indexing for matrix items