changing setmatrix and getmatrix function names to setinverse and getinverse for clarity