update the script with 2 function for matrix inverse