write the cacheMatrix.R file