wrote two functions about Matrix Inversion