Code changes for computing inverse of a matrix