Implement cache functions in cacheMatrix.R