Amended and Restated Note Purchase Agreement