EXHIBIT A AMENDED AND RESTATED STOCK PURCHASE AGREEMENT