cacheMatrix function.