how closeout netting reduces the credit risk for two firms engaged in several derivatives contracts

Explain how closeout netting reduces the credit risk for two firms engaged in several derivatives contracts ? How does the legal system impose risk on a derivatives dealer? Consider a firm that has assets that generate cash but which cannot be easily valued on a regular basis. What are the difficulties faced by this firm when using VAR and what alternatives would it have?