SECOND AMENDMENT AND RESTATEMENT AGREEMENT