My version of the matrix inversion functions.