AMENDED AND Restated NOTE PURCHASE AGREEMENT