added comments to cachesolve method