Create a new function for matrix inversion