solution of cacheMatrix.R