EXHIBIT 2.4 AMENDED AND RESTATED STOCK PURCHASE AGREEMENT dated as of October 19, 2004