EXHIBIT 4(am) AMENDMENT NO. 2 dated as of October 9, 1997 (this "Amendment"), to (a) the Amended and Restated Credit Agreement dated as of June 16, 1997 (the "Amended and Restated Credit Agreement"), among Magellan Health Services, Inc., a Delaware corporation (the "Parent Borrower"); Charter Behavioral Health System of New Mexico, Inc., a New Mexico corporation (collectively with the Parent Borrower, the "Borrowers"); the Lenders (as defined in Article I of the Amended and Restated Credit Agreement); The Chase Manhattan Bank, a New York banking corporation, as administrative agent (in such capacity, the "Administrative Agent") for the Lenders, as collateral agent for the Lenders (the "Collateral Agent") and as an issuing bank (in such capacity, an "Issuing Bank"); and First Union National Bank (formerly known as First Union National Bank of North Carolina), a national banking corporation, as syndication agent for the Lenders and as an issuing bank (in such capacity, together with The Chase Manhattan Bank in its capacity as an Issuing Bank, the "Issuing Banks"), and (b) the Amended and Restated Pledge Agreement dated as of June 16, 1997 (the "Amended and Restated Pledge Agreement"), among the Parent Borrower, each subsidiary of the Parent Borrower listed on Schedule I thereto (each such subsidiary, individually, a "Subsidiary Pledgor", and, collectively, the "Subsidiary Pledgors") and the Collateral Agent. A. The Lenders and the Issuing Banks have extended credit to the Borrowers, and have agreed to extend credit to the Borrowers, in each case pursuant to the terms and subject to the conditions set forth in the Amended and Restated Credit Agreement. B. The Parent Borrower has requested that the Amended and Restated Credit Agreement and the Amended and Restated Pledge Agreement be amended as set forth herein. C. The Required Lenders are willing so to amend the Amended and Restated Credit Agreement and the Amended and Restated Pledge Agreement pursuant to the terms and subject to the conditions set forth herein. D. Capitalized terms used but not defined herein have the meanings assigned to them in the Amended and Restated Credit Agreement. Accordingly, in consideration of the mutual agreements herein contained and other good and valuable consideration, the sufficiency and receipt of which are hereby acknowledged, the parties hereto agree as follows: SECTION 1. Amendment to Section 1.01 of the Amended and Restated Credit Agreement. (a) The definition of the term "Acquired Entity EBITDA" set forth in Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by deleting the words "for purposes of clause (c) of the definition of Consolidated EBITDA, the net income of any Acquired Entity for any period" from the first and second lines of such definition and inserting in lieu thereof the following phrase: "with respect to any Acquired Entity for any period, the net income of such Acquired Entity for such period". (b) The definition of the term "Consolidated EBITDA" set forth in Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by inserting, at the end of such definition, the following sentence: "Notwithstanding anything to the contrary set forth in this definition, for purposes of calculating Consolidated EBITDA for any period, there shall be excluded from Acquired Entity EBITDA with respect to such period the net income (or loss) attributable to each Specified Acquired Entity to the extent that cash has not been distributed by such Specified Acquired Entity to the Parent Borrower or any of the Subsidiaries (other than any other Specified Acquired Entity) during such period." (c) The definition of the term "Consolidated Net Income" set forth in Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by deleting the words "all extraordinary gains or losses and (iii)" from the eight and ninth lines of such definition and inserting in lieu thereof the following phrase: the net income (or loss) attributable to any Specified Entity to the extent that cash has not been distributed by such Specified Entity to the Parent Borrower or any of the Subsidiaries (other than any other Specified Entity) during such period, (iii) all extraordinary gains or losses and (iv). (d) The definition of the term "Permitted Acquisition" set forth in Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by inserting the words "(except as provided in the proviso to Section 6.05(e)) " (i) after the word "shall" in the twenty-fifth line of such Section and (ii) after the word "shall" in the twenty-seventh line of such Section. (e) The definition of the term "Permitted Non-Control Investment" set forth in Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by inserting the words "except in the case of the capital stock of a Specified Joint Venture or a Specified Newly Formed Subsidiary," after the phrase "(c)" in the sixteenth line of such Section. (f) Section 1.01 of the Amended and Restated Credit Agreement is hereby amended by inserting, in appropriate alphabetical order, the following definitions: "Specified Acquired Entity" shall mean any Subsidiary that is an Acquired Entity with respect to which the Borrowers have not complied with any of the provisions of Section 5.11 because of the proviso to Section 6.05(e). "Specified Entity" shall mean any Specified Acquired Entity, any Specified Joint Venture or any Specified Newly Formed Subsidiary. "Specified Joint Venture" shall mean any joint venture that is formed or entered into by the Borrowers or any Guarantor after the Closing Date if the granting by the Borrowers or any Guarantor of a security interest in the capital stock owned by the Borrowers or such Guarantor in such joint venture would violate applicable law or any regulation, rule, order, approval, license or other restriction issued or imposed by any Governmental Authority. "Specified Newly Formed Subsidiary" shall mean any Subsidiary that (a) is formed by the Borrowers or any Guarantor after the Closing Date and (b) with respect to which compliance with Section 5.11 would violate applicable law or any regulation, rule, order, approval, license or other restriction issued or imposed by any Governmental Authority. SECTION 2. Amendment to Section 5.04 of the Amended and Restated Credit Agreement. Section 5.04(e) of the Amended and Restated Credit Agreement is hereby amended by (a) deleting the word "and " appearing after the phrase "security;" in the eleventh line of such Section and (b) by inserting the following sentence at the end of such Section: ; and (v) all Specified Entities, which shall include (A) the total assets of each of the Specified Entities, (B) the Acquired Entity EBITDA of each Specified Acquired Entity and (C) the aggregate amount of cash distributed by each Specified Entity to the Parent Borrower or any of the Subsidiaries, in each case, calculated as of the last day of the most recent month for which financial statements have been delivered pursuant to Section 5.04(c). SECTION 3. Amendment to Section 5.11 of the Amended and Restated Credit Agreement. (a) Section 5.11 of the Amended and Restated Credit Agreement is hereby amended by inserting the words "(except in the case of a Specified Newly Formed Subsidiary and except as provided in the proviso to Section 6.05(e))" after the word "will" in the seventh line of such Section. (b) Section 5.11 of the Amended and Restated Credit Agreement is hereby amended by inserting the words "(except as provided in the proviso to Section 6.05(e))" after the word "will" in the thirteenth line of such Section. (c) Section 5.11 of the Amended and Restated Credit Agreement is hereby amended by inserting the following sentence after the word "Document" in the fifteenth line of such Section: ; provided, however, that the Borrowers and the Guarantors will not be required to comply with the provisions of this sentence with respect to the capital stock of any Specified Joint Venture or any Specified Newly Formed Subsidiary if compliance with the provisions of this sentence with respect to such capital stock would violate applicable law, regulation, rule, order, approval, license or other restriction issued or imposed by any Governmental Authority. SECTION 4. Amendment to Section 6.04 of the Amended and Restated Credit Agreement. Section 6.04 of the Amended and Restated Credit Agreement is hereby amended by (a) deleting the word "and" appearing at the end of clause (p) of such Section, (b) deleting the period at the end of clause (q) of such Section and substituting therefor the phrase "; and" and (c) adding, following paragraph (q) of such Section, the following paragraph: (r) investments by the Parent Borrower or any Subsidiary in shares of the capital stock of any Specified Entity so long as, after giving effect to any such investment, the total assets of all Specified Entities taken as a whole, calculated on a consolidated basis as of the last day of the most recent month for which financial statements have been delivered pursuant to Section 5.04(c), do not exceed 10% of the total assets of the Parent Borrower and its Subsidiaries on a consolidated basis as of such date. SECTION 5. Amendment to Section 6.05 of the Amended and Restated Credit Agreement. Section 6.05 of the Amended and Restated Credit Agreement is hereby amended by inserting, before the semicolon in clause (e) of such Section, the following: ; provided, however, that the Borrowers will not be required to comply with the provisions of Section 5.11 with respect to any Subsidiary that is an Acquired Entity (and the acquisition of such Acquired Entity shall constitute a Permitted Acquisition notwithstanding the failure of such acquisition to satisfy the criteria set forth in clauses (c)(ii) and (c)(iii) of the definition of the term "Permitted Acquisition") if (i) compliance with Section 5.11 with respect to such Acquired Entity would violate applicable law or any regulation, rule, order, approval, license or other restriction issued or imposed by any Governmental Authority and (ii) after giving effect to the acquisition of such Acquired Entity, no Default or Event of Default under Section 6.04(r) shall have occurred and be continuing. SECTION 6. Amendment to Section 6.06 of the Amended and Restated Credit Agreement. (a) Section 6.06(a) of the Amended and Restated Credit Agreement is hereby amended by (i) deleting the word "and" appearing at the end of clause (a)(vi) of such Section, (ii) deleting the period at the end of clause (vii) of such Section and substituting therefor the phrase "; and" and (iii) adding, following paragraph (vii) of such Section, the following paragraph: (viii) to the extent that any Subsidiary is a Specified Entity, such Subsidiary may declare and pay dividends if and to the extent that the restriction contained in this Section 6.06 on such declaration or payment would violate applicable law or any regulation, rule, order, approval, license or other restriction issued or imposed by any Governmental Authority, provided that any such declaration and payment is pro rata to the shareholders, partners or other equity holders, as the case may be, of such Specified Entity. (b) Section 6.06(b)(B) of the Amended and Restated Credit Agreement is hereby amended by inserting the words "or any regulation, rule, order, approval, license or other restriction issued by any Governmental Authority" after the word "law" in such Section. SECTION 7. Amendment to Section 1 of the Amended and Restated Pledge Agreement. Section 1 of the Amended and Restated Pledge Agreement is hereby amended by (a) inserting the phrase "(a)" after the word "excluding" in the seventh line of such Section and (b) inserting the words ", (b) any Specified Joint Venture or (c) any Specified Newly Formed Subsidiary" after the word "Agreement" in the ninth line of such Section. SECTION 8. Representations and Warranties. Each Borrower represents and warrants to the Administrative Agent and to each of the Lenders that: (a) This Amendment has been duly authorized, executed and delivered by it and constitutes its legal, valid and binding obligation of each Loan Party party hereto, enforceable against such Loan Party in accordance with its terms. (b) Before and after giving effect to this Amendment, the representations and warranties set forth in Article III of the Amended and Restated Credit Agreement are true and correct in all material respects with the same effect as if made on the date hereof, except to the extent such representations and warranties expressly relate to an earlier date. (c) Before and after giving effect to this Amendment, no Event of Default or Default has occurred and is continuing. SECTION 9. Conditions to Effectiveness. This Amendment shall become effective as of the date first above written when the Administrative Agent shall have received counterparts of this Amendment that, when taken together, bear the signatures of the Borrowers, the Subsidiary Pledgors and the Required Lenders. SECTION 10. Amended and Restated Credit Agreement and Amended and Restated Pledge Agreement. Except as specifically amended hereby, each of the Amended and Restated Credit Agreement and the Amended and Restated Pledge Agreement shall continue in full force and effect in accordance with the provisions thereof as in existence on the date hereof. After the date hereof, any reference to (a) the Amended and Restated Credit Agreement shall mean the Amended and Restated Credit Agreement as amended hereby and (b) the Amended and Restated Pledge Agreement shall mean the Amended and Restated Pledge Agreement as amended hereby. SECTION 11. Applicable Law. THIS AMENDMENT SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK. SECTION 12. Counterparts. This Amendment may be executed in two or more counterparts, each of which shall constitute an original but all of which when taken together shall constitute but one agreement. SECTION 13. Expenses. The Parent Borrower agrees to reimburse the Agent for its out-of-pocket expenses in connection with this Amendment, including the reasonable fees, charges and disbursements of Cravath, Swaine & Moore, counsel for the Administrative Agent. IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be duly executed by their respective authorized officers as of the day and year first written above. MAGELLAN HEALTH SERVICES, INC., by /s/ James R. Bedenbaugh -------------------------------- Name: James R. Bedenbaugh Title: Vice President and Treasurer CHARTER BEHAVIORAL HEALTH SYSTEM OF NEW MEXICO, INC. , by /s/ Charlotte A. Sanford ----------------------------- Name: Charlotte A. Sanford Title: Treasurer THE SUBSIDIARY PLEDGORS LISTED ON SCHEDULE I-A HERETO, by /s/ Charlotte A. Sanford --------------------------------- Name: Charlotte A. Sanford Title: Treasurer THE SUBSIDIARY PLEDGORS LISTED ON SCHEDULE I-B HERETO, by /s/ James R. Bedenbaugh ------------------------------------ Name: James R. Bedenbaugh Title: Vice President and Treasurer THE CHASE MANHATTAN BANK, individually and as Administrative Agent, Collateral Agent and an Issuing Bank, by /s/ Dawn Lee Lum ------------------------ Name: Dawn Lee Lum Title: Vice President FIRST UNION NATIONAL BANK, individually and as Syndication Agent and an Issuing Bank, by /s/ Joseph H. Towell ------------------------------ Name: Joseph H. Towell Title: Senior Vice President BANK POLSKA KASA OPIEKI S.A. PEKAO S.A. GROUP, NEW YORK BRANCH, by /s/ William A. Shea ----------------------------- Name: William A. Shea Title: Senior Lending Officer CREDIT LYONNAIS NEW YORK BRANCH, as Co-Agent, by /s/ Farboud Tavangar ----------------------------- Name: Farboud Tavanger Title: First Vice President FIRST AMERICAN NATIONAL BANK, by /s/ Sandy Hamrich ------------------------------- Name: Sandy Hamrich Title: Vice President GENERAL ELECTRIC CAPITAL CORPORATION, as Co-Agent, by /s/ Holly Kaczmarcyk -------------------------------- Name: Holly Kaczmarcyk Title: Duly Authorized Signatory THE BANK OF NEW YORK, as Co-Agent, by /s/ Alan F. Lyster, Jr. -------------------------- Name: Alan F. Lyster, Jr. Title: Vice President THE BANK OF NOVA SCOTIA, as Co-Agent, by /s/ W. J. Brown ---------------------- Name: W. J. Brown Title: Vice President BANK OF TOKYO-MITSUBISHI TRUST COMPANY, by ------------------------- Name: Title: VAN KAMPEN AMERICAN CAPITAL RATE INCOME TRUST, by /s/ Jeffrey W. Maillet ---------------------------------------- Name: Jeffrey W. Maillet Title: Senior Vice President & Director