Exhibit 10.31 AMENDED AND RESTATED LOAN AGREEMENT