modified cacheMatrix.R