Updates to the matrix functions and added an example