Have updated the script to solve for the inverse of the matrix