EXHIBIT 10.40 AMENDED AND RESTATED LOAN AGREEMENT Dated as of November 5, 1999