remove inline and put not in docstring: modifies matrix *in place*