update cacheMatrix function