modified makeCachedMatrix and cacheSolve functions