Document:

Exhibit 10.5

    
      
        

      

    

     Exhibit
      10.5

    

      
        FIRST
          AMENDMENT TO

        SECOND
          AMENDED AND RESTATED INTERCREDITOR 

        AND
          SUBORDINATION AGREEMENT

         

        THIS
          FIRST AMENDMENT TO SECOND AMENDED AND RESTATED INTERCREDITOR AND SUBORDINATION
          AGREEMENT (herein called this “Amendment”)
          is
          made as of the 29th day of June, 2005, by and among THE ROYAL BANK OF SCOTLAND
          plc, as agent (in such capacity, and together with any successor in such
          capacity, the “Subordinated
          Agent”)
          for
          each of the lenders that is signatory to, or which becomes a signatory
          to, the
          Subordinated Credit Agreement (collectively, the “Subordinated
          Lenders”),
          and
          BANK OF AMERICA, N.A., as agent (in such capacity as agent, and together
          with
          any successor in such capacity, the “Senior
          Agent”)
          for
          each of the lenders that is signatory to, or which becomes a signatory
          to the
          Senior Credit Agreement (collectively, the “Senior
          Lenders”).

        

        BRIGHAM
          EXPLORATION COMPANY, a Delaware corporation (the “Parent”), BRIGHAM OIL &
          GAS, L.P., a Delaware limited partnership (“BOG”), and BRIGHAM, INC., a Nevada
          corporation (“BI”) are signatories hereto solely for the purpose of evidencing
          their acknowledgment and consent to the terms and conditions of this Amendment.
          

        

        W
          I T N E S S E T H:

        

        WHEREAS,
          the Senior Agent, the Subordinated Agent, the Parent, BOG and BI are parties
          to
          the Second Amended and Restated Intercreditor and Subordination Agreement
          dated
          as of January 21, 2005 (the “Original
          Agreement”),
          for
          the purposes and consideration therein expressed; 

        

        WHEREAS,
          the Senior Agent and the Subordinated Agent desire to amend the Original
          Agreement for the purposes described herein; 

        

        NOW,
          THEREFORE, in consideration of the premises and the mutual covenants and
          agreements contained herein and in the Original Agreement, in consideration
          of
          the loans which may hereafter be made by Senior Lenders and the Subordinated
          Lenders to BOG, and for other good and valuable consideration, the receipt
          and
          sufficiency of which are hereby acknowledged, the parties hereto do hereby
          agree
          as follows: 

        

        ARTICLE
          I.

        DEFINITIONS
          AND REFERENCES

        

        Section
          1.1.    Defined
          Terms.
          Unless
          the context otherwise requires or unless otherwise expressly defined herein,
          the
          terms defined in the Original Agreement shall have the same meanings whenever
          used in this Amendment. As used herein, the following terms shall have
          the
          following meanings: 

        

        “Intercreditor
          Agreement”
          means
          the Original Agreement as amended by this Amendment. 

         

      

      
        
          
          

        

        
          1

          
            

          

        

        
          
          

        

      

       

      
        ARTICLE
          II.
AMENDMENTS
          

         

        Section
          2.1.  Introductory
          Paragraph and Recitals.

        

        (a) 
Any
          references to “Senior
          Agent”
          contained in the Original Agreement shall be amended to refer to Bank of
          America, N.A., as agent (in such capacity as agent, and together with any
          successor in such capacity.

        

        (b) 
Recital
          A
          of the Original Agreement is hereby amended in its entirety as
          follows:

         

        A. 
BOG,
          as
          the borrower, the Senior Lenders and the Senior Agent are parties to that
          certain Fourth Amended and Restated Credit Agreement dated as of June 29,
          2005
          (such agreement, as the same may be from time to time amended, modified,
          supplemented, restated, refinanced or replaced, the “Senior
          Credit Agreement”),
          pursuant to which the Senior Lenders have made certain credit available
          to and
          on behalf of BOG.

         

        (c) 
Recital
          E
          of the Original Agreement is hereby amended in its entirety as
          follows:

         

        E. 
BOG
          has
          entered into that certain Second Amended and Restated Subordinated Credit
          Agreement dated as of January 21, 2005 with the Subordinated Agent and
          the
          Subordinated Lenders, as amended by the First Amendment to Second Amended
          and
          Restated Subordinated Credit Agreement dated as of June 29, 2005 (such
          agreement, as amended and as the same may be from time to time further
          amended,
          modified, supplemented, restated, refinanced or replaced as permitted herein,
          the “Subordinated
          Credit Agreement”)
          pursuant to which the Subordinated Lenders will make loans to BOG, such
          advances
          to be evidenced by a promissory note executed and delivered by BOG in accordance
          with the Subordinated Credit Agreement (such promissory note, as the same
          may be
          from time to time amended, modified, supplemented, restated, refinanced
          or
          replaced as permitted herein, the “Subordinated
          Note”).

         

        Section
          2.2.  Section
          3.3(c)
          of the
          Original Agreement is hereby amended by replacing “$20,000,000” with
“$40,000,000”.

        

        Section
          2.3.  Section
          4.3
          of the
          Original Agreement is hereby amended by replacing the notice information
          set
          forth therein with the following:

        

        Bank
          of
          America, N.A.

      

       

      
        
          
          

        

        
          2

          
            

          

        

        
          
          

        

      

      
         

        ARTICLE
          III.

         

        CONSENT

         

        Section
          3.1.    Consent
          and Waiver.
          The
          Senior Agent hereby consents to the execution and delivery of the First
          Amendment to Second Amended and Restated Subordinated Credit Agreement
          dated as
          of June 29, 2005 among BOG, Subordinated Agent and the Subordinated Lenders
          (the
“First
          Amendment”)
          and to
          the transactions described therein and waives any and all defaults arising
          or
          which may have heretofore arisen under Section 3.3 of the Original Agreement
          as
          a result of the First Amendment or such transactions. The consents and
          waivers
          contained herein are limited to the extent described herein and shall not
          be
          construed to be a consent to or a waiver of any other actions prohibited
          by the
          Intercreditor Agreement or the Senior Loan Documents. The Senior Agent
          reserves
          the right to exercise any rights and remedies available to it in connection
          with
          any future defaults with respect to Section 3.3 of the Intercreditor Agreement
          and any other provision of any other Senior Loan Document. 

         

        ARTICLE
          IV.

         

        MISCELLANEOUS

         

        Section
          4.1.   Ratification
          of Agreements.
          The
          Original Agreement as hereby amended is hereby ratified and confirmed in
          all
          respects. Without in any way modifying or limiting the foregoing, each
          of the
          undersigned Credit Parties hereby (a) consents to the provisions
          of this
          Amendment and the transactions contemplated herein, and (b) ratifies
          and
          confirms its obligations made by it in favor of Senior Agent for the benefit
          of
          each Senior Lender and the Subordinated Agent for the benefit of each
          Subordinated Lender pursuant to and in accordance with Article II of the
          Intercreditor Agreement, and agrees that its obligations and covenants
          thereunder are unimpaired hereby and shall remain in full force and effect.
          Any
          reference to the Intercreditor Agreement in any Senior Loan Document or
          Subordinated Loan Document shall be deemed to be a reference to the Original
          Agreement as hereby amended. The execution, delivery and effectiveness
          of this
          Amendment shall not, except as expressly provided herein, operate as a
          waiver of
          any right, power or remedy of the Senior Lenders or the Subordinated Lender
          under the Intercreditor Agreement or any other Senior Loan Document or
          Subordinated Loan Document, as the case may be, nor constitute a waiver
          of any
          provision of the Intercreditor Agreement or any Senior Loan Document or
          Subordinated Loan Document. 

         

        Section
          4.2.     GOVERNING
          LAW.
          THIS
          AMENDMENT SHALL BE GOVERNED BY, AND CONSTRUED AND ENFORCED IN ACCORDANCE
          WITH,
          THE LAWS OF THE STATE OF NEW YORK. 

         

        Section
          4.3.  Counterparts.
          This
          Amendment may be separately executed in counterparts and by the different
          parties hereto in separate counterparts, each of which when so executed
          shall be
          deemed to constitute one and the same Amendment. 

         

        
          
            
            

          

          
            3

            
              

            

          

          
            
            

          

        

         

        THIS
          AMENDMENT REPRESENT THE FINAL AGREEMENT BETWEEN THE PARTIES AND MAY NOT
          BE
          CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS, OR SUBSEQUENT ORAL
          AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS AMONG
          THE
          PARTIES HERETO.

         

        [Signatures
          on Following Page]

         

        

          
            
              
              

            

            
              4

              
                

              

            

            
              
              

            

          

        

      

       

      IN
        WITNESS WHEREOF, this Amendment is executed as of the date first above written.
        

      

        
          	 	 	 	
                  SENIOR
                    AGENT:

                	 
	 	 	 	 	 
	 	 	 	
                  BANK
                    OF AMERICA, N.A.,

                	 
	 	 	 	
                  as
                    the Senior Agent

                	 
	 	 	 	 	 
	 	 	 	
                  /s/
                    Matthew C. Correia

                	 
	 	 	 	
                  Assistant
                    Vice President

                	 
	 	 	 	 	 
	 	 	 	 	 
	 	 	 	
                  SUBORDINATED
                    AGENT:

                	 
	 	 	 	 	 
	 	 	 	
                  THE
                    ROYAL BANK OF SCOTLAND plc,

                	 
	 	 	 	
                  as
                    the Subordinated Agent

                	 
	 	 	 	 	 
	 	 	 	
                  /s/
                    Phillip R. Ballard

                	 
	 	 	 	
                  Senior
                    Vice President

                	 
	 	 	 	 	 
	BRIGHAM
                  EXPLORATION COMPANY,	 	 	 
	a
                  Delaware corporation	 	 	 
	 	 	 	 	 
	/s/
                  Eugene B. Shepherd,
                  Jr.	 	 	 
	Executive
                  Vice President and Chief Financial Officer	 	 	 
	 	 	 	 	 
	BRIGHAM
                  OIL & GAS, L.P.,	 	 	 
	a
                  Delaware limited partnership	 	 	 
	 	 	 	 	 
	
                  By:     
                    Brigham,
                    Inc., its General Partner

                	 	 	 
	 	 	 	 	 
	/s/
                  Eugene B. Shepherd, Jr.	 	 	 
	Executive
                  Vice President and Chief Financial Officer	 	 	 
	 	 	 	 	 
	BRIGHAM,
                  INC.,	 	 	 
	a
                  Nevada corporation	 	 	 
	 	 	 	 	 
	/s/
                  Eugene B. Shepherd, Jr.	 	 	 
	Executive
                  Vice President and Chief Financial Officer 	 	 	 

        

         

        5<PAGE>

EXHIBIT 10.44

                    FIRST AMENDMENT TO STOCKHOLDERS AGREEMENT

         This First Amendment to Stockholders Agreement ("First Amendment")
dated effective as of July 29, 2005 is made by and among Energy Spectrum
Partners, LP ("Energy Spectrum"), the Investors Group (as defined in Section 1.1
of the Agreement), the Directors Group (as defined in Section 1.1 of the
Agreement) and Allis-Chalmers Energy Inc., formerly known as Allis-Chalmers
Corporation ("Company"). Energy Spectrum, the Investors Group and the Directors
Group shall, as long as each such person or group of Persons owns Stock, be
collectively referred to herein as the "Stockholders".

                                    RECITALS

         WHEREAS, Energy Spectrum, the Investors Group, the Directors Group and
the Company entered into that certain Stockholders Agreement dated as of April
2, 2004 ("Agreement");

         WHEREAS, the parties to the Agreement desire to amend the Agreement by
deleting Sections 2.1, 3.1, 3.2 and 3.4, and retaining Sections 2.2(a), 2.2(b),
2.2(c), 2.3 and 2.4 while suspending the rights of Energy Spectrum, the Investor
Group and the Director Group as described herein.

         NOW, THEREFORE, in consideration of the premises and the mutual
covenants set forth herein and other valuable consideration, the receipt and
sufficiency of which is hereby acknowledged, the parties hereto, intending to be
legally bound, agree as follows:

                                    ARTICLE 1
                                  GENERAL TERMS

         1.1 TERMS DEFINED IN AGREEMENT. As used in this First Amendment, except
as may otherwise be provided herein, all capitalized terms which are defined in
the Agreement, as amended, have the same meanings herein as therein, all of such
terms and their definitions being incorporated by reference.

         1.2 CONFIRMATION AND EXTENT OF CHANGES. All terms which are defined or
referred to in the Agreement shall remain unchanged except as otherwise
specifically provided in this Amendment. It is hereby confirmed that the term
"Agreement" includes the Agreement as amended by this First Amendment.

                                    ARTICLE 2
                                   AMENDMENTS

         2.1      AMENDMENT TO SECTION 2.1 AND 2.2(a)

                  (a) Effective as of the date hereof, Section 2.1 shall be
         deleted in its entirety.

                                       1
<PAGE>

                  (b) Section 2.2(a) shall remain unchanged, however, Energy
         Spectrum has notified the Company that two of its nominees to the Board
         of Directors have resigned and that Energy Spectrum at this time does
         not plan to designate replacements thereto. In addition, Energy
         Spectrum hereby agrees not to utilize its right to appoint two
         replacement directors unless, and until it notifies the Company in
         writing of its determination to assert such right.

         2.2 AMENDMENT TO SECTIONS 2.2(b), 2.2(c), 2.3 AND 2.4. Sections
2.2(b)and 2.2(c) shall be suspended and the Investors Group and the Directors
Group shall not have the right to designate nominees for election to the Board
unless and until Energy Spectrum has notified the Company, the Investors Group
and the Directors Group that Energy Spectrum intends to assert its right to
designate pursuant to Section 2.2(a) of the Agreement. In the event that Energy
Spectrum so notifies the Company, the Investors Group and the Directors Group of
its intention to reinstate such right to designate two additional directors,
then the rights of the Investor Group and the Directors Group pursuant to
Sections 2.2(b) and 2.2(c) shall be reinstated in accordance with the Agreement.

         2.3 TERMINATION OF SECTION 3. Section 3 of the Agreement shall be
terminated in its entirety effective as of the date hereof.

         2.4 TERMINATION OF STOCKHOLDERS AGREEMENT. The Company, Energy Spectrum
and certain other stockholders are proposing to sell pursuant to a public
offering under the Securities Act of 1933, as amended, shares of common stock of
the Company. In the event that such public offering, results in the sale of all
shares of common stock held by Energy Spectrum or such amount that Energy
Spectrum holds less than 5% of the then outstanding shares of common stock of
the Company, then following consummation of the public offering the Agreement
and this First Amendment shall be terminated in all respects.

                                    ARTICLE 3
                                  MISCELLANEOUS

         3.1 EFFECTIVE DATE. Except as otherwise expressly provided herein, the
effective date of all provisions of this First Amendment shall be the date of
execution indicated below.

         3.2 TITLES OF ARTICLES, SECTIONS AND SUBSECTIONS. All titles or
headings to articles, sections, subsections or other divisions of this First
Amendment are only for the convenience of the parties and shall not be construed
to have any effect or meaning with respect to the other content of such
articles, sections, subsections, or other discussion, such other content being
controlling as to the Agreement among the parties hereto.

         3.3 COUNTERPARTS. This First Amendment may be executed in two or more
counterparts. It will not be necessary that the signatures of all parties hereto
be contained on any one counterpart hereof; each counterpart shall be deemed an
original, but all of which together shall constitute one and the same
instrument.

                                       2
<PAGE>

         3.4 ENTIRE AGREEMENT. This First Amendment embodies the final, entire
agreement among the parties hereto with respect to the subject matter hereof and
thereof and supersedes any and all prior commitments, agreements,
representations and understandings whether written or oral, relating to this
First Amendment, and may not be contradicted or varied by evidence of prior,
contemporaneous or subsequent oral agreements or discussions of the parties
hereto.

         3.5 MODIFICATION. Except as expressly modified by this First Amendment,
the Agreement shall remain in full force and effect.

         IN WITNESS WHEREOF, the parties have executed this Agreement to be
effective as of July 29, 2005.

                                 THE COMPANY:
                                 ------------
                                 ALLIS-CHALMERS ENERGY INC.

                                 /S/ MUNAWAR H. HIDAYATALLAH
                                 ---------------------------
                                 Munawar H. Hidayatallah
                                 Chief Executive Officer

                                 DIRECTORS GROUP:

                                 /S/ MUNAWAR H. HIDAYATALLAH
                                 ---------------------------
                                 Munawar H. Hidayatallah

                                 /S/ JENS H. MORTENSEN
                                 ---------------------
                                 Jens H. Mortensen

                                 /S/ SAEED M. SHEIKH
                                 -------------------
                                 Saeed M. Sheikh

                                 INVESTORS GROUP:
                                 ----------------

                                 /S/ LEONARD TOBOROFF
                                 --------------------
                                 Leonard Toboroff

                                       3
<PAGE>

                                 ENGEL DEFINED BENEFIT PLAN
                                 --------------------------

                                 By: /S/ DONALD ENGEL
                                     ----------------
                                     Donald Engel

                                 RER CORP.
                                 ---------

                                 /S/ ROBERT NEDERLANDER
                                 ----------------------
                                 Robert Nederlander, President

                                 /S/ DONALD ENGEL
                                 ----------------
                                 Donald Engel

                                 /S/ CHRISTOPHER ENGEL
                                 ---------------------
                                 Christopher Engel

                                 ENERGY SPECTRUM PARTNERS, LP:
                                 -----------------------------
                                 By: Energy Spectrum Capital LP, General Partner
                                 By: Energy Spectrum LLC, General Partner

                                 /S/ THOMAS WHITENER
                                 -------------------
                                 Name: Thomas Whitener
                                 Title: Partner

                                       4

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00088-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00088-of-00352.parquet"}]]