changes related to caching inverse of a matrix