Pricing mortgages with default and prepayment