Updated cacheMatrix code