SECOND AMENDED AND RESTATED LOAN agreement