Implemented finding the inverse of a matrix.