Implement makeCachedMatrix and cachedSolve.