**EXHIBIT 10.1****FIRST MODIFICATION TO LOAN DOCUMENTS**     **THIS FIRST MODIFICATION TO THE LOAN DOCUMENTS**(“First Modification”) is given to be effectiveas of June 30, 2006, and is entered into by and among **FIRST NATIONAL BANK OF COLORADO,**a nationalbank association, as lender (“Lender”), **METRETEK TECHNOLOGIES, INC.**, a Delaware corporation, asguarantor (the “Guarantor”), **SOUTHERN FLOW COMPANIES, INC.**, a Delaware corporation, as borrower anddebtor (“Southern Flow”), **POWERSECURE, INC.**, a Delaware corporation, as borrower and debtor(“PowerSecure”), **METRETEK INCORPORATED**, a Florida corporation (“Metretek”). Southern Flow andPowerSecure are hereinafter sometimes referred to collectively herein as “Borrower” or “Borrowers”.**RECITALS**     This First Modification is entered into upon the basis of the following facts andcircumstances:     A. Lender, Borrowers, Guarantor and Metretek have entered into that certain Credit Agreementdated as of September 2, 2005 (the “Agreement”), pursuant to which Lender has agreed to extend arevolving line of credit to PowerSecure in the maximum aggregate amount of Two Million Five HundredThousand and 00/100 Dollars ($2,500,000.00) (the “Credit Facility A”), and a revolving line ofcredit to Southern Flow in the maximum aggregate amount of Two Million and 00/100 Dollars($2,000,000.00) (the “Credit Facility B”).     B. Credit Facility A and Credit Facility B are further evidenced by PowerSecure’s Facility ANote and Southern Flow’s Facility B Note dated September 2, 2005 (the “Notes”).     C. Payment of the Notes is guaranteed by that certain Commercial Guaranty executed byGuarantor for the benefit of Lender (the “Guaranty”).     D. The parties have agreed to modify the Loan Documents on the terms and conditions set forthherein.**AGREEMENT**     NOW, THEREFORE, in consideration of the foregoing Recitals and the promises and agreementscontained herein, the undersigned parties hereby agree to amend and modify the Loan Documents, asfollows:     **1. ****Modification of Credit Agreement**. The Credit Agreement is hereby amended asfollows:
1

 
          (a) Annual Facility Fee Definition. The definition of “Annual Facility Fee” is herebydeleted.          (b) Promise to Pay Fees. Section 3.2 is hereby deleted and replaced in its entirety asfollows:3.2 Promise to Pay Fees. Each Borrower shall pay an Annual UnusedFee on the average daily unused amount of the Credit Facility A and CreditFacility B during the preceding quarter and payable, in arrears, on the lastday of each quarter, and continuing on the last day of each quarter untilthe Maturity Date*.*The initial payment of the Annual Unused Feewill be prorated based on the number of days from the Closing Date throughthe date the fee is paid, divided by the number of days in the quarterending as of such date payable or the last Business Day of such quarter. IfBorrower fails to make, when due, any payment of fees or expenses specifiedor referred to in this Agreement due to Lender, including, withoutlimitation, Annual Unused Fee referred to in this Section or fees referredto elsewhere in this Agreement or in any separate agreement between Borrowerand Lender relating to this Agreement or the transactions contemplatedhereby, the amount due shall bear interest until paid at the Default Rate.Furthermore, such amount shall constitute part of the Facilities, secured byall of the Collateral.          (c) Annual Unused Fee Definition. The definition of “Annual Unused Fee” is herebydeleted and replaced in its entirety as follows:“Annual Unused Fee” means 0.125% of the average unused amount of theFacility A Total Draw Commitment or the Facility B Total Draw Commitment, asapplicable.          (d) Eligible A/R Definition. The definition of “Eligible A/R” is hereby deleted andreplaced in its entirety as follows:“Eligible A/R” shall mean Accounts of PowerSecure or Southern Flow,as applicable, arising in the ordinary course of such applicable Borrower’sbusiness from arms-length transactions, provided, however, that unlessotherwise approved by Lender in writing, a Account shall not constitute anEligible A/R if:(i) any account receivable or part thereof which is disputed or againstwhich any defense or counter-claim or right of setoff has been asserted;(ii) accounts where debtor has filed bankruptcy;(iii) any account of the United States government or any department oragency thereof arising under a contract with any such account debtor,
2

 
unlesssuch account is assignable and has been duly assigned to Lender andacknowledged in accordance with federal law;(iv) any account of an account debtor whose chief executive officer orprincipal place of business is located outside of the United States ofAmerica;(v) any account which is unpaid more than ninety (90) days past the datewhen payment is due on the invoice therefore;(vi) any account of a person or entity which is controlled by or controls oris under common control with the account creditor or any account of anemployee of the account creditor;(vii) all accounts of an account debtor if ten percent (10%) or more of thetotal amount owed by the account debtor to the account creditor is ninety(90) days or more past due;(viii) any account in which the Lender does not have a perfected, firstpriority security interest;(ix) any account which the Lender reasonably determines to be ineligiblefor, among any number of reasons, includes that the account is of doubtfulcollection value.          (e) Eligible Inventory Definition. The definition of “Eligible Inventory” is herebydeleted and replaced in its entirety as follows:“Eligible Inventory” means all Inventory of PowerSecure or SouthernFlow, as applicable, provided, however, that unless otherwise approved byLender, no Inventory shall constitute Eligible Inventory if:(i) such Inventory is owned in whole or in part by any Person otherthan PowerSecure or Southern Flow, as applicable;(ii) PowerSecure or Southern Flow, as applicable, does not have a good,valid and marketable title to such Inventory;(iii) any Inventory that is obsolete, damaged, defective or otherwise unableto be sold or used;(iv) any Inventory not located in the United States of America;(v) any Inventory in which the Lender does not have a valid, perfected firstpriority security interest, including all Inventory in which anothercreditor asserts a purchase money security interest, unless the purchasemoney security interest has been subordinated to the security interests ofLender in a form acceptable to Lender;(vi) such Inventory does not conform in all respects to the warrantiescontained in this Agreement and the other Loan Documents; or
3

 
(vii) the Lender, in its reasonable discretion, designates such Inventory tobe ineligible.          (f) Facility B Borrowing Base Definition. The definition of “Facility B BorrowingBase” is hereby deleted and replaced in its entirety as follows:“Facility B Borrowing Base” means (a) 80% of Eligible A/R ofSouthern Flow, plus (b) 20% of Eligible Inventory of Southern Flow, all ascalculated on the most recent monthly Borrowing Base Report.          (g) Interest; Interest Payments. Section 3.1(a) is hereby deleted and replaced inits entirety as follows:3.1(a) Interest; Interest Payments. The Borrowers agree to payinterest on the Facility A Draw Outstandings or the Facility B DrawOutstandings, as applicable, from time to time as provided herein. Intereston the Credit Facility A and on the Credit Facility B shall be due andpayable monthly in arrears on the first (1st) of each month,commencing August 1, 2006. With respect to both Borrowers, the unpaidprincipal balance of each Advance will bear interest at an annual rate equalto the Prime Rate. The applicable rate shall change on each day on whichthe Prime Rate changes.          (h) Closing Deliveries. Section 6.2(c) is hereby deleted.          (i) Monthly Financial Statements; Accounts Receivable Aging; Borrowing Base Report.Section 7.1(c) is hereby deleted and replaced in its entirety as follows:7.1(c) Accounts Receivable Aging; Borrowing Base Report. Along withBorrower’s next request for an Advance and submission of a Borrowing Noticeand within thirty (30) days after the end of each calendar month during theFiscal Year thereafter, (i) Borrowing Base Report of Borrower; and (ii)accounts receivable aging; each covering the periods from the end of theimmediately preceding Fiscal Year of the Borrower, to the end of such month,and for such month alone (if applicable), all in such detail as Lender mayrequest and signed and certified to be correct by the president or chieffinancial officer of each Borrower and Guarantor, as applicable or otherfinancial officer satisfactory to Lender.          (j) Investments and Advances. Section 8.7 is hereby deleted and replaced in itsentirety as follows:8.7 Investments and Advances.Make any investment in, or advances to, any other Person, firm, orcorporation, except (a) advance payments or deposits against purchases madein the ordinary course of Borrower’s
4

 
regular business; (b) directobligations of the United States of America; (c) money market mutual fundsthat invest in direct obligations of the United States of America; (d)advances to other Obligors or their Affiliates (subject to the restrictionsthereon provided in this Agreement and provided no Default or Event ofDefault has occurred and is continuing), (e) investments in commercial paperand variable or fixed rate notes issued or guaranteed by U.S. corporationsrated “A-1” or “A-2” by Standard & Poor’s Corporation or “P-1” or “P-2” byMoody’s Investors Service or certificates of deposit or bankers’ acceptanceshaving a maturity of one year or less issued by members of the FederalReserve System having deposits in excess of $200,000,000 (which certificatesof deposit or bankers’ acceptances are fully insured by the Federal DepositInsurance Corporation); and (f) investments, classified in accordance withGAAP as current assets, in money market investment programs registered underthe Investment Company Act of 1940, as amended, which are administered byreputable financial institutions having capital of at least $500,000,000 andthe portfolios of which are limited to investments of the characterdescribed in foregoing clauses (b), (c), (e) and (f). In addition to theforegoing, an Obligor shall be permitted to make any other investmentpermitted under the Company’s Investment Policy as currently in effect, oras amended from time to time with the consent of the Lender.          (k) Inter-Company Liability – PowerSecure. Section 8.9 is hereby deleted in itsentirety.          (l) PowerSecure Financial Covenants. Section 8.11(a)(i) is hereby deleted in itsentirety.          (m) PowerSecure Financial Covenants. Section 8.11(a)(ii) is hereby deleted in itsentirety.          (n) PowerSecure Financial Covenants. Section 8.11(a)(iii) is hereby deleted in itsentirety and replaced as follows:8.11(a)(iii) Current Assets to Current Liabilities Ratio.PowerSecure shall maintain a ratio of Current Assets of PowerSecure toCurrent Liabilities of PowerSecure of no less than 1.10:1, as of the end ofany fiscal quarter. For purposes of this paragraph, (A) neither Facilityshall be considered a Current Liability and (b) the Current Assets andCurrent Liabilities calculation shall exclude all receivables, loans orother advances owed to PowerSecure by any affiliate or made by PowerSecureto any Affiliate.
5

 
          (o) Southern Flow Financial Covenants. Section 8.11(b)(i) is hereby deleted in itsentirety.          (p) Southern Flow Financial Covenants. Section 8.11(b)(ii) is hereby deleted in itsentirety and replaced as follows:8.11(b)(ii) Tangible Net Worth. Southern Flow shall maintain a TangibleNet Worth of Southern Flow of no less than $1,500,000, as of the end ofany fiscal quarter.          (q) Guarantor Financial Covenants. Section 8.11(c)(i) is hereby deleted in itsentirety and replaced as follows:8.11(c)(i) Debt to Tangible Net Worth Ratio. Guarantor, on aconsolidated basis as of the end of any fiscal quarter, shall not permit theratio of Debt to Tangible Net Worth to exceed 2.00:1 during the time periodbeginning on the date hereof and at all times thereafter.          (r) Guarantor Financial Covenants. Section 8.11(c)(ii) is hereby deleted in itsentirety.     **2. ****Modification of Facility A Note**. The interest rate on the outstanding principalbalance of Facility A Note is reduced to the Prime Rate. Borrower shall pay interest on theoutstanding principal balance of Facility A Note at the rate per annum equal to the Prime Rate.     **3. ****Modification of Facility B Note.** The interest rate on the outstanding principalbalance of Facility B Note is reduced to the Prime Rate. Borrower shall pay interest on theoutstanding principal balance of Facility B Note at the rate per annum equal to the Prime Rate.     **4. ****Modification of Loan Documents**. Any references in the Loan Documents to the CreditAgreement, the Notes, or the Commercial Guaranty shall mean the Credit Agreement, the Notes and theCommercial Guaranty as modified by this First Modification.     **5. ****Definitions****.**All capitalized terms used in this First Modification which are nototherwise defined herein shall have the meanings ascribed to them in the Credit Agreement. Thedefined terms set forth in this First Modification are hereby incorporated into the CreditAgreement.     **6. ****No Other Modifications**. Except as expressly amended and modified by the terms ofthis First Modification, the terms and conditions of the Loan Documents shall remainunchanged and in full force and effect and are hereby ratified and confirmed by Borrowers andGuarantor.
6

 
     **7. ****Ratification**. The parties hereby ratify and confirm the continued force and effectof the Loan Documents, as modified by this First Modification, without change except asspecifically amended by this First Modification. It is expressly understood and agreed that thisFirst Modification shall in no manner alter or affect (except as expressly provided therein),extinguish or impair the Indebtedness evidenced by the Loan Documents, and shall not extinguish orimpair any rights and remedies of the Lender thereunder or the priority of the Loan Documents.     **8. ****Ratification of Guarantor**. Guarantor hereby (a) consents to the amendment of theLoan Documents as set forth in this First Modification, (b) ratifies and confirms the continuedforce and effect of the Loan Documents, as modified by this First Modification, without changeexcept as specifically amended by this First Modification, (c) ratifies and confirms the continuedforce and effect of the Commercial Guaranty to which Guarantor is signatory, and (d) covenants andagrees with the Lender to perform in a full and timely manner all of its obligations under the LoanDocuments to which she is signatory, in accordance with such Loan Documents.     **9. ****No Release**. Borrowers and Guarantor specifically acknowledge and agree thatnothing contained in this First Modification shall be understood or construed to be a satisfactionor release in whole or in part of any Indebtedness evidenced by the Loan Documents, or to be anamendment or waiver of any of the provisions of the Loan Documents, except as specifically setforth in this First Modification, or as reasonably necessary to effect the amendments containedherein. Except as otherwise necessary to effect the intent hereof, the terms and conditions of theLoan Documents shall continue in full force and effect without change. Borrowers and Guarantorhereby affirm their respective agreements to be bound by all of the obligations, covenants,liabilities and warranties set forth in the Loan Documents in accordance with their respectiveterms, as amended by this First Modification, and acknowledge that no defenses exist to theenforcement of the Loan Documents in accordance with their respective terms and no basis exists forasserting any offset or other claim against the Lender.     **10. ****Representations and Warranties**. Borrowers and Guarantor represents and warrantsto the Lender:          (a) To its knowledge after due inquiry regarding Credit Facility A or Credit Facility B, noDefault or Event of Default under any of the Loan Documents, nor any event, that, with the givingof notice or the passage of time or both, would be a Default or an Event of Default under the LoanDocuments herein has occurred and is continuing.          (b) There has been no material adverse occurrence regarding the Obligors.          (c) Except as disclosed in writing by the Borrowers and Guarantor to Lender as of the datehereof, each and all representations and warranties of Borrowers and Guarantor inthe Loan Documents are restated and reaffirmed and are accurate on the date hereof to the same
7

 
extent as though made as of the date of this First Modification, except to the extent suchrepresentations and warranties specifically relate to an earlier date.          (d) The Borrowers and Guarantor have no claims, counterclaims, defenses, or set-offs againstLender with respect to Credit Facility A or Credit Facility B or the Loan Documents.          (e) The Loan Documents, as modified herein, to which Borrowers and Guarantor are signatory arethe legal, valid, and binding obligation of Borrowers and Guarantor, enforceable against suchBorrowers and Guarantor in accordance with their terms.          (f) Each of the Borrowers and Guarantor which is a legal entity is validly existing under thelaws of the state of its formation or organization and has the requisite power and authority toexecute and deliver this First Modification and to perform the Loan Documents to which suchBorrowers and Guarantor is signatory. The execution and delivery of this First Modification and theperformance of the Loan Documents as modified herein have been duly authorized by all requisiteaction by or on behalf of each Borrowers and Guarantor. This First Modification has been dulyexecuted and delivered on behalf of each Borrowers and Guarantor.     **11. ****Savings Clause**. If any provision in this First Modification is invalid, illegal,or unenforceable, the remaining provisions shall not be affected or impaired thereby, and thereshall be substituted for the invalid, illegal, or unenforceable provision the most similarprovision that is valid, legal and enforceable.     **12. ****Counterparts**. This First Modification may be executed in any number ofcounterparts, each of which shall be deemed an original, and all of which taken together shallconstitute one and the same First Modification.*[REMAINDER OF PAGE INTENTIONALLY LEFT BLANK]*
8

 
IN WITNESS WHEREOF, the parties have executed this Agreement as of the date first above written.           **BORROWERS:**                   POWERSECURE, INC.   SOUTHERN FLOW COMPANIES, INC.             By: /s/ A. Bradley Gabbard, August 7, 2006   By: /s/ A. Bradley Gabbard, August 7, 2006               A. Bradley Gabbard,     A. Bradley Gabbard,    Executive Vice President and CFO     Executive Vice President and CFO             Address: 230 Capcom Avenue, Suite 107   Address: 132 Demanade Blvd.    Wake Forest, North Carolina 27587     Lafayette, LA 70503  Facsimile: (919) 556-3596   Facsimile: 337-237-3790             **GUARANTOR:**   **METRETEK:**             METRETEK TECHNOLOGIES, INC.   METRETEK INCORPORATED             By: /s/ A. Bradley Gabbard, August 7, 2006   By: /s/ A. Bradley Gabbard, August 7, 2006               A. Bradley Gabbard,     A. Bradley Gabbard,    Executive Vice President and CFO     Executive Vice President and CFO             Address: 303 East 17th Avenue, Suite 660   Address: 305-A East Drive    Denver, CO 80203     Melbourne, FL 32904  Facsimile: 303-785-8085   Facsimile: 321-259-2900  **LENDER:**       FIRST NATIONAL BANK OF COLORADO           By: /s/ Greg H. Atkinson Greg H. Atkinson,      Vice President    Address: 3033 Iris Avenue    Boulder, CO 80301-9032    Facsimile: 303-443-0181