modified file for matrix inverse