Updated the docstring for Matrix
Fixed misnamed Matrix local variables from 'sv' to 'mat'
Fixed misnamed local variables and docstrings referring to stacks