Design and Valuation of Debt Contracts