implemented CachedMatrix object and cacheSolve