EXHIBIT 10.4



 Exhibit 10.4 
  
 SECOND AMENDMENT TO CREDIT AGREEMENT 
  
 THIS SECOND AMENDMENT TO CREDIT AGREEMENT (this “Second Amendment”) is dated as of this 30th day of September, 2004, by and between TREX COMPANY, INC., a Delaware corporation (sometimes hereinafter referred to
herein as “Trex Inc.”), and BRANCH BANKING AND TRUST COMPANY OF VIRGINIA, a Virginia state banking corporation (hereinafter referred to herein as the “Bank”). 
  
 Trex Inc., TREX Company, LLC, a Delaware limited liability company (“TREX LLC”), and the Bank are the original
parties to that certain Credit Agreement dated as of June 19, 2002, as amended by a First Amendment to Credit Agreement dated as of August 29, 2003 (as so amended and as it may hereafter be amended, restated, supplemented, replaced or otherwise
modified from time to time, the “Credit Agreement”). Subject to the terms and conditions contained in the Credit Agreement, the Bank agreed to extend to Trex Inc. and TREX LLC (i) a revolving credit facility, with a letter of credit
subfacility, in the aggregate amount of $20,000,000 for working capital financing of Trex Inc.’s and TREX LLC’s accounts receivable and inventory, to purchase new equipment and/or for other general corporate purposes of Trex Inc. and TREX
LLC, (ii) a term loan facility in the amount of $9,570,079.88 to refinance the Winchester Property (as defined in the Credit Agreement), and (iii) a term loan facility in the amount of $3,029,920.12 to finance existing improvements to the Winchester
Property. Effective December 31, 2002, TREX LLC merged with and into Trex Inc., with Trex Inc. being the surviving entity. As a result of such merger, Trex Inc. is the sole borrower under the Credit Agreement and shall hereinafter sometimes be
referred to in this Second Amendment as the “Borrower.” Real Estate Term Loan 4 (as defined in the Credit Agreement), which is evidenced by Real Estate Term Loan Note 4 (as defined in the Credit Agreement), has been paid in full.

  
 The Borrower has requested that the Bank release its security
interest in the Revolving Credit Loan Collateral (as defined in the Credit Agreement) that secures the Revolving Credit Loan Obligations (as defined in the Credit Agreement), to extend the Revolving Credit Termination Date (as defined in the Credit
Agreement), to extend the maturity date of Real Estate Term Loan 1, Real Estate Term Loan 2 and Real Estate Term Loan 3 (as each such term is defined in the Credit Agreement), and to make certain other modifications to the Credit Agreement, and the
Bank is willing to do so upon the terms and conditions contained herein. 
  
 Accordingly, the Borrower and the Bank hereby agree as follows: 
  
 1. Capitalized terms used in this Second Amendment and not otherwise defined herein shall have the meanings assigned thereto in the Credit Agreement.

  
 2. Section 2.01(a) of the Credit Agreement is hereby deleted
in its entirety and the following Section is substituted in its place: 
  
 (a) Term Loans. The Bank agrees, on the terms and conditions set forth in this Agreement, to make (i) a term loan to the Borrower on September 30, 2004 in the principal amount of Two Million Six Hundred Ninety-Seven Thousand Four Hundred
Fifty-Two and 53/100s Dollars ($2,697,452.53) (“Real Estate Term Loan 

  









 
1”), (ii) a term loan to the Borrower on September 30, 2004 in the principal amount of Seven Hundred Fifty-Seven Thousand Fifty-One and 77/100s Dollars
($757,051.77) (“Real Estate Term Loan 2”) and (iii) a term loan to the Borrower on September 30, 2004 in the principal amount of Four Million Nine Hundred Sixty-Four Thousand Two Hundred Seventy-Six and 00/100s Dollars ($4,964,276.00
(“Real Estate Term Loan 3”). 
  
 3. All references in
the Credit Agreement and in the Definitions Appendix to the Credit Agreement to each of the terms, “Real Estate Term Loan 4” and “Real Estate Term Loan Note 4,” are hereby deleted in their entirety. 
  
 4. Sections 2.01(c)ii.6. and 2.01(c)ii.8. of the Credit Agreement are hereby
deleted in their entirety and the following Sections are substituted in their respective places: 
  
 6. the account receivable is not subject to any assignment, security interest, lien, claim, or encumbrance of any kind; 
  
 8. [Reserved]. 
  
 5. Section 2.01(c)iii.(vi) of the Credit Agreement is hereby deleted in its
entirety and the following Section is substituted in its place: 
  
 (vi) which is not subject to any assignment, security interest, lien, claim, or encumbrance of any kind,  
  
 6. Section 2.07(b) of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 (b) Mandatory Prepayment. Not later than thirty (30)
calendar days after the Borrower’s or the Bank’s receipt of any Personal Property Casualty Loss Proceeds or Net Proceeds and not later than 210 calendar days after the Borrower’s receipt of any Fixed Asset Proceeds that are not
reinvested in accordance with the provisions of Section 6.14(b)(ii) hereof, the Borrower shall repay, or the Bank shall pay, as applicable, the Revolving Loans in immediately available funds in an amount equal to such Personal Property Casualty Loss
Proceeds, Net Proceeds or Fixed Asset Proceeds. 
  
 7. Section
2.08(c) of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 (c) Real Estate Term Loans 1, 2 & 3. Real Estate Term Loans 1, 2 & 3 shall be due and payable as set forth in Real Estate Term
Loan Note 1, Real Estate Term Loan Note 2 and Real Estate Term Loan Note 3, respectively; provided that the principal balance of Real Estate Term Loans 1, 2 & 3, together with all accrued interest thereon, shall be immediately due and payable in
full on September 30, 2009. 
  









 8. Section 3.01(a) of the Credit Agreement is hereby deleted in its entirety and the following Section is
substituted in its place: 
  
 (a) [Reserved].

  
 9. Section 3.01(b) of the Credit Agreement is hereby deleted
in its entirety and the following Section is substituted in its place: 
  
 (b) To the extent required by Section 6.23 hereof, the guaranty of each Material Subsidiary. 
  
 10. Section 4.02(b)(ii) of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 (ii) with respect to the Borrower’s first request for a Revolving Loan
after each occurrence of any fire, theft, water damage, vandalism or other damage to or loss of any Inventory for which insurance proceeds are paid to the Borrower, the Borrower shall have executed and delivered to the Bank a new Borrowing Base
Certificate based on information as of the date of such request; 
  
 11. The first sentence of Section 5.20 of the Credit Agreement is hereby deleted in its entirety and the following sentence is substituted in its place: 
  
 Schedule 5.20 (as such Schedule may be amended by a writing delivered by the Borrower to the Bank from time to time
after the Effective Date) is a complete and correct listing of all Material Debt other than Debt associated with the Revolving Credit Loan Obligations, the Real Estate Term Loan Obligations or the Note Agreement. 
  
 12. Section 6.03(b) of the Credit Agreement is hereby deleted in its entirety
and the following provision is substituted in its place: 
  
 (b) In addition to the insurance requirements set forth in the Deed of Trust, the Borrower will maintain, and will cause each of its Subsidiaries to maintain, insurance with financially sound and responsible companies
in such amounts (and with such risk retentions and with such deductibles) and against such risks as is usually carried by owners of similar businesses and properties in the same general areas in which the Borrower and its Subsidiaries operate, and
the Borrower will maintain not less than $64,000,000 of business interruption insurance at all times (or such lesser amount as the Bank may agree to in its reasonable discretion). The Bank shall be named as loss payee and additional insured on all
insurance policies insuring the Collateral. Not less frequently than annually and more frequently if the Bank shall so request, the Borrower shall deliver to the Bank certificates evidencing that it is named as loss payee and additional insured on
all insurance policies insuring the Collateral and the Borrower shall promptly deliver such other information as the Bank shall reasonably request from time to time. 
  









 13. The first sentence of Section 6.07 of the Credit Agreement is hereby deleted in its entirety and the
following sentence is substituted in its place: 
  
 The Borrower
will not, and will not permit any of its Subsidiaries to, without the prior written consent of the Bank, create, incur, assume or suffer to exist any Lien upon or with respect to any Corporate Assets, or other accounts, or ownership interests in its
Subsidiaries, or proceeds thereof, or sell any Corporate Assets, or other accounts or ownership interests in its Subsidiaries, or proceeds thereof subject to an understanding or agreement, contingent or otherwise, to repurchase such Corporate
Assets, or other accounts, or ownership interests in its Subsidiaries, or proceeds thereof (including sales of accounts receivable or notes with recourse to the Borrower or any of its Subsidiaries) or assign any right to receive income, or file or
permit the filing of any financing statement under the Uniform Commercial Code as in effect in any applicable jurisdiction or any other similar notice of Lien under any similar recording or notice statute, provided that the provisions of this
Section 6.07 shall not prevent the creation, incurrence, assumption or existence of the following (with such Liens described below being herein referred to as “Permitted Liens”): 
  
 14. Section 6.07(j) of the Credit Agreement is hereby deleted in its entirety
and the following Section is substituted in its place: 
  
 (j) [Reserved]; 
  
 15. Section 6.07(l) of the Credit
Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 (l) Liens existing on the Closing Date and set forth on Schedule 6.07(l) to this Agreement, and the extension, renewal or
replacement of any such Lien, provided that (i) such Lien attaches only to the same property as the original Lien, (ii) the principal amount of Debt secured by such Lien is not increased and (iii) at the time of such extension, renewal or
replacement, no Default or Event of Default shall have occurred and be continuing;  
  
 16. Section 6.07(n) of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 (n) [Reserved].  
  
 17. Sections 6.07(o) and 6.07(p) of the Credit Agreement are hereby deleted in their entirety and the following Sections are
substituted in their places: 
  
 (o) interests of
lessors under Capital Leases; 
  
 (p) Liens on
the Mississippi Facility, but only to the extent that such Liens secure only the Mississippi Financing; and 
  









 (q) in addition to the Liens permitted under clauses (a) to and including (p) of this
Section 6.07, Liens securing Debt that does not exceed $250,000 in the aggregate. 
  
 18. Clause (v) in Section 6.08 of the Credit Agreement is hereby deleted in its entirety and the following clause is substituted in its place: 
  
 (v) additional Facility Debt incurred after the Closing Date, provided that at the time such additional Facility Debt is
incurred (1) no Default or Event of Default shall have occurred or will occur as a result of the incurrence of such Facility Debt and (2) the aggregate principal amount of such additional Facility Debt is not greater than $10,000,000; 
  
 19. Section 6.09 of the Credit Agreement is hereby deleted in its entirety
and the following Section is substituted in its place: 
  
 Section 6.09 Limitations on Capital Expenditures. Without the prior written consent of the Bank, the Borrower and its Subsidiaries shall not make capital expenditures of more than the following aggregate amounts in each of its fiscal
years, provided that the Borrower may expend an amount equal to the unspent portion of monies from the immediately preceding fiscal year in the immediately succeeding fiscal year: $30,000,000 for fiscal year 2004; and $25,000,000 for each fiscal
year thereafter. Notwithstanding the immediately preceding sentence, the Borrower may make capital expenditures in excess of the amounts set forth in the immediately preceding sentence if, in a particular fiscal year, [the difference between the
figure equal to clause (i) of the definition of the Fixed Charge Coverage Ratio for such fiscal year minus non-Maintenance Capital Expenditures for such fiscal year] divided by [the figure equal to clause (ii) of the definition of the Fixed Charge
Coverage Ratio for such fiscal year] is equal to or greater than 1.0 to 1 
  
 20. Section 6.10 of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 Section 6.10 Total Consolidated Debt to Total Consolidated Capitalization Ratio. The Borrower will
not, as of the end of any calendar month, permit the ratio of Total Consolidated Debt to Total Consolidated Capitalization (the “Total Consolidated Debt to Total Consolidated Capitalization Ratio”), as a percentage, to exceed the following
amounts for the following periods: (i) 55% for the period commencing on the Closing Date to and including December 31, 2004 and (ii) 50% thereafter. 
  
 21. Section 6.11 of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 Section 6.11. Total Consolidated Debt to Consolidated
EBITDA Ratio. The Borrower will not, as of the end of any fiscal quarter, permit the ratio of the 

  









 
Total Consolidated Debt to Consolidated EBITDA (the “Total Consolidated Debt to Consolidated EBITDA Ratio”) for the four-quarter period ended as of
the end of such fiscal quarter to exceed 2.50 to 1. 
  
 22.
Section 6.12 of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 Section 6.12. Fixed Charge Coverage Ratio. The Borrower will not, as of the end of any fiscal quarter, permit the Fixed Charge
Coverage Ratio for the four quarter period ended as of the end of such fiscal quarter to be less than 1.50 to 1. 
  
 23. Section 6.13 of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 Section 6.13. Minimum Tangible Net Worth. The
Borrower will at all times maintain Consolidated Tangible Net Worth at not less than the sum of (i) $100,000,000, (ii) 100% of the Net Proceeds of all stock issued after the Closing Date, plus (iii) fifty percent (50%) of Consolidated Net Income
after June 30, 2004 (taken as one accounting period), but excluding from such calculation of Consolidated Net Income for purposes of this clause (iii) any quarter in which Consolidated Net Income is negative. 
  
 24. Section 6.14(b)(ii) of the Credit Agreement is hereby deleted in its
entirety and the following Section is substituted in its place: 
  
 (ii) provided that no Default or Event of Default has occurred or would occur as a result of the consummation of such sale or other disposition, the sale or other disposal of assets (but specifically excluding the real property and the
improvements thereon encumbered by the Deed of Trust or the Nevada Deed of Trust) for fair market value which the Borrower determines are no longer needed for the operation of the business of the Borrower and its Subsidiaries; provided that the
aggregate net book value of assets so disposed of shall not exceed $2,500,000 in any fiscal year; provided further that if the Borrower or the applicable Subsidiary (A) acquires fixed assets useful and intended to be used in the operation of the
business of the Borrower and its Subsidiaries, such fixed assets have an actual out-of-pocket cost equal to or greater than the proceeds resulting from such sale or other disposition, and such fixed assets are acquired within 210 days of such sale
or other disposition or (B) applies the net proceeds of any such sales which exceed $2,500,000 in any fiscal year (such excess net proceeds, “Fixed Asset Proceeds”) to prepay the Revolving Credit Loan Obligations, such sale or other
disposition shall be excluded from the calculation of the amount in this clause (ii);  
  









 25. Section 6.20 of the Credit Agreement is hereby deleted in its entirety and the following provision is
substituted in its place: 
  
 Section 6.20.
Deposit Accounts. The Borrower and its Subsidiaries shall maintain all of their primary deposit accounts, including without limitation their primary operating deposit accounts, with the Bank and, if requested by the Bank, will establish and
maintain a lock box cash management system in an assignee account at the Bank. 
  
 26. Section 6.23 of the Credit Agreement is hereby deleted in its entirety and the following Section is substituted in its place: 
  
 Section 6.23 Additional Guaranty Agreement Documentation. 
  
 (a) If, at any time after the date hereof, (1) any of the
Borrower’s Subsidiaries becomes a Material Subsidiary or (2) the Borrower forms or acquires any Material Subsidiary, then the Borrower shall provide to the Bank the following documentation: 
  
 (i) a subsidiary guaranty that guarantees the Revolving
Credit Loan Obligations, in form and substance acceptable to the Bank, and duly executed and delivered by such Subsidiary; 
  
 (ii) a certificate from the chief executive officer, chief financial officer or treasurer of such Subsidiary, in form and substance
reasonably satisfactory to the Bank, to the effect that all representations and warranties of such Subsidiary contained in the subsidiary guaranty are true, correct and complete in all material respects; that such Subsidiary is not in violation of
any of the covenants contained in the subsidiary guaranty; and that no Default or Event of Default has occurred and is continuing or, after giving effect to its execution and delivery of the subsidiary guaranty, will occur; 
  
 (iii) a certificate of the secretary or other appropriate
officer or authorized person of such Subsidiary certifying as to the incumbency and genuineness of the signature of each officer or authorized signer of such Subsidiary executing the subsidiary guaranty and certifying that attached thereto is (A) a
true and complete copy of the articles of incorporation, articles of organization, partnership agreement or equivalent organizational document of such Subsidiary, and all amendments thereto, certified as of a recent date by the appropriate
governmental official of its jurisdiction of formation; (B) a true and complete copy of the bylaws, operating agreement, or equivalent agreement of such Subsidiary as in effect on the date of such certification; (C) a true and complete copy of
resolutions duly adopted by the board of directors, members, managers or equivalent governing body of such Subsidiary authorizing the execution, delivery and performance of the subsidiary guaranty; and (D) a true and complete copy of each
certificate required to be delivered pursuant to Section 6.23(iv) hereof; 
  
 (iv) a certificate of good standing of such Subsidiary as of a recent date from the appropriate governmental official of its jurisdiction of 

  









 
formation and in each other jurisdiction where such Subsidiary is qualified to do business; 
  
 (v) a favorable opinion of counsel to such Subsidiary addressed to the Bank in form and substance
satisfactory to the Bank with respect to such Subsidiary and the subsidiary guaranty, and such other matters as the Bank shall request; and 
  
 (vi) such other documents, instruments, certificates, opinions and other information as the Bank shall reasonably request. 
  
 (b) In addition to the other limitations contained in this
Agreement, the Borrower will not permit any Material Subsidiary which has not signed a subsidiary guaranty at that time to be or become liable in respect of any other Guarantee after the date hereof; provided, however, that such Material Subsidiary
may execute and deliver such Guarantee so long as the Borrower shall contemporaneously therewith cause such Material Subsidiary to execute and deliver, and such Material Subsidiary shall execute and deliver to the Bank, a subsidiary guarantee,
together with all other documents, agreements, certificates and opinions in compliance with the terms and provisions of this Section 6.23. It is the intent of this Section 6.23(b) that at all times the Borrower shall cause all Subsidiaries which
have executed and delivered Guarantees to holders of Debt of the Borrower and/or any other Material Subsidiary to have executed and delivered all of the documentation in accordance with and pursuant to the provisions of this Section 6.23.

  
 (c) The Borrower shall pay on demand all
reasonable out-of-pocket fees and expenses of the Bank, including without limitation the reasonable fees and expenses of counsel to the Bank, incurred in connection with the execution and delivery of the subsidiary guaranties and the related
documents, agreements, certificates and opinions described in this Section 6.23. 
  
 27. The definition of the term, “Applicable Revolving Loan Margin,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted
in its place: 
  
 “Applicable Revolving Loan
Margin” means (i) 1.25% for the period from September 30, 2004 through and including the first day of the month following receipt by the Bank of the consolidated financial statements described in Section 6.01(b) for the period ending June 30,
2004 and (ii) thereafter shall be determined by reference to the Total Consolidated Debt to Consolidated EBITDA Ratio in accordance with the following table: 
  

			
	 Total Consolidated Debt to
 Consolidated
EBITDA Ratio

	  	Applicable Revolving
Loan Margin


	 Equal to or higher than 1.5 to 1
	  	1.75%
	 Equal to or higher than 1.0 to 1 but lower than 1.5 to 1
	  	1.50%
	 Lower than 1.0 to 1
	  	1.25%

  









 Except during the initial period described in clause (i) above, the Applicable Revolving Loan Margin will
be automatically adjusted as of the first day of the month following receipt by the Bank of consolidated financial statements of the Borrower and its Consolidated Subsidiaries pursuant to Section 6.01(a) or Section 6.01(b) demonstrating to the
Bank’s reasonable satisfaction that there has been a change in the Total Consolidated Debt to Consolidated EBITDA Ratio which would cause a change in the Applicable Revolving Loan Margin in accordance with the preceding table. Any such change
shall apply to the Revolving Loans outstanding on such effective date or made on or after such effective date. At all times after and during the continuance of a Default with respect to the Borrower’s obligations under Section 6.01(a) or
Section 6.01(b) until the delivery of the applicable financial statements required pursuant thereto, the Applicable Revolving Loan Margin shall be 1.75%. 
  
 28. The definition of the term, “Applicable Real Estate Term Loan Margin,” contained in the Definitions Appendix to the Credit Agreement is
hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Applicable Real Estate Term Loan Margin” means (i) 1.50% for the period from September 30, 2004 through and including the first
day of the month following receipt by the Bank of the consolidated financial statements described in Section 6.01(b) for the period ending June 30, 2004 and (ii) thereafter shall be determined by reference to the Total Consolidated Debt to
Consolidated EBITDA Ratio in accordance with the following table: 
  

			
	 Total Consolidated Debt to
 Consolidated
EBITDA Ratio

	  	Applicable Real Estate
Term Loan Margin


	 Equal to or higher than 1.5 to 1
	  	2.00%
	 Equal to or higher than 1.0 to 1 but lower than 1.5 to 1
	  	1.75%
	 Lower than 1.0 to 1
	  	1.50%

  









 Except during the initial period described in clause (i) above, the Applicable Real Estate Term Loan
Margin will be automatically adjusted as of the first day of the month following receipt by the Bank of consolidated financial statements of the Borrower and its Consolidated Subsidiaries pursuant to Section 6.01(a) or Section 6.01(b) demonstrating
to the Bank’s reasonable satisfaction that there has been a change in the Total Consolidated Debt to Consolidated EBITDA Ratio which would cause a change in the Applicable Real Estate Term Loan Margin in accordance with the preceding table. Any
such change shall apply to Real Estate Term Loans 1, 2 & 3 outstanding on such effective date. At all times after and during the continuance of a Default with respect to the Borrower’s obligations under Section 6.01(a) or Section 6.01(b)
until the delivery of the applicable financial statements required pursuant thereto, the Applicable Real Estate Term Loan Margin shall be 2.00%. 
  
 29. The definition of the term, “Collateral,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety
and the following definition is substituted in its place: 
  
 “Collateral” means the Winchester Property, as more particularly described in the Deed of Trust. 
  
 30. The Definitions Appendix to the Credit Agreement is hereby amended by inserting the following new terms in the correct alphabetical order in the
Definitions Appendix: 
  
 “Corporate
Assets” means, collectively, all real property and personal property assets now or hereafter owned or acquired by the Borrower and/or any of its Subsidiaries, including without limitation chattel paper, deposit accounts, documents, equipment,
general intangibles, goods, instruments, investment property, letter-of-credit rights, software (as each of the foregoing terms is defined in the UCC), Accounts, Inventory, patent, trademark, copyright or other rights in or associated with
intellectual property, and the Collateral. 
  
 “Mississippi Facility” means the Borrower’s new manufacturing plant to be located in Olive Branch. Mississippi, including the land such facility is situated on, the building and improvements located thereon and the equipment
located thereon and used in the operation thereof. 
  
 “Mississippi Financing” means Debt incurred by the Borrower in connection with the issuance by Mississippi Business Finance Corporation of variable rate demand bonds in the approximate principal amount of $25,000,000.00, the
proceeds of which shall be used in connection with the acquisition, construction and equipping of the Mississippi Facility (including the reimbursement of funds previously expended by the Borrower for such purpose). 
  
 31. The Definitions Appendix to the Credit Agreement is hereby amended by
deleting each of the following terms in their entirety: “Collateral Agent,” “Intercreditor 

  









 
Agreement,” “Revolving Credit Loan Collateral,” “Revolving Credit Loan Collateral Documents,” and “Security Agreement.”
 
  
 32. The definition of the term, “Inventory
Sublimit,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Inventory Sublimit” means (i) $14,000,000 for the period commencing on May 1, 2004 and continuing
to and including September 30, 2004; (ii) $16,000,000 for the period (A) commencing on May 1, 2005 and continuing to and including September 30, 2005, (B) commencing on May 1, 2006 and continuing to and including September 30, 2006 and (C)
commencing on May 1, 2007 and continuing to and including September 30, 2007; and (iii) for any period not identified in clauses (i) or (ii) above, the Revolving Credit Commitment. 
  
 33. The definition of the term, “Loan Documents,” contained in the Definitions Appendix to the Credit Agreement is
hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Loan Documents” means this Agreement, the Notes, the Deed of Trust, the Letter of Credit Applications, the ISDA Master
Agreement, the Services Agreement, and each subsidiary guaranty executed and delivered pursuant to Section 6.23 hereof, and each other document, instrument or agreement executed and delivered by the Borrower, its Subsidiaries or their counsel in
connection with this Agreement or otherwise referred to herein or contemplated hereby, all as amended, restated, supplemented or otherwise modified from time to time. 
  
 34. The definition of the term, “Management Stockholders,” contained in the Definitions Appendix to the Credit
Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Management Stockholders” means Robert G. Matheny, Harold F. Monahan, Paul D. Fletcher, William R. Gupp, David W. Jordan and
Philip Pfifer, and their respective Management Stockholder Affiliates. 
  
 35. The definition of the term, “Material Debt,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Material Debt” means Debt (other than the Notes)
of the Borrower and/or one or more Subsidiaries owed to any Person or any Affiliates of such Person, arising in one or more related or unrelated transactions with such Person or any Affiliates of such Person, in an aggregate principal amount
exceeding $250,000. 
  









 36. The definition of the term, “Revolving Credit Loan Obligations,” contained in the
Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Revolving Credit Loan Obligations” means: 
  
 (i) all principal of and interest (including, without limitation, any interest which accrues after the
commencement of any case, proceeding or other action relating to the bankruptcy, insolvency or reorganization of the Borrower, whether or not allowed or allowable as a claim in any such proceeding) on the Revolving Loan, Letters of Credit, fees
payable or reimbursement obligation under, or any note issued pursuant to, the Letters of Credit, or the Revolving Loan; 
  
 (ii) all other amounts now or hereafter payable by the Borrower and all other obligations or liabilities now existing or hereafter arising
or incurred (including, without limitation, any amounts which accrue after the commencement of any case, proceeding or other action relating to the bankruptcy, insolvency or reorganization of the Borrower, whether or not allowed or allowable as a
claim in any such proceeding) on the part of the Borrower pursuant to the Letters of Credit, or the Revolving Note; and 
  
 (iii) all renewals, modifications, consolidations or extensions of or to each of the obligations described in clauses (i) to and including
(ii) above. 
  
 37. The definition of the term, “Revolving
Credit Period,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Revolving Credit Period” means the period from and including the Effective Date to but not
including September 30, 2007. 
  
 38. The definition of the term,
“Revolving Credit Termination Date,” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Revolving Credit Termination Date” means the
earlier to occur of September 30, 2007, or the date of termination by the Bank pursuant to Section 7.01. 
  
 39. The definition of the term, “Total Consolidated Debt” contained in the Definitions Appendix to the Credit Agreement is hereby deleted in its
entirety and the following definition is substituted in its place: 
  
 “Total Consolidated Debt” means, as of the date of determination, the total of all Debt of the Borrower and its Subsidiaries outstanding on such date, after (i) eliminating all offsetting debits and credits
between the Borrower and its Subsidiaries and all other items required to be eliminated in the course of the preparation of consolidated financial statements of the Borrower and its Subsidiaries in accordance with GAAP and (ii) subtracting an amount
equal to the cash and Cash Equivalents in excess of $10,000,000 held by the Borrower on the date of determination. 
  









 40. The definition of the term, “Unused Commitment Fee Percentage,” contained in the
Definitions Appendix to the Credit Agreement is hereby deleted in its entirety and the following definition is substituted in its place: 
  
 “Unused Commitment Fee Percentage” means (i) 0.20% for the period from September 30, 2004 through and including the first day of
the month following receipt by the Bank of the consolidated financial statements described in Section 6.01(b) for the period ending June 30, 2004 and (ii) thereafter shall be determined by reference to the Total Consolidated Debt to Consolidated
EBITDA Ratio in accordance with the following table: 
  

			
	 Total Consolidated Debt to
 Consolidated
EBITDA Ratio

	  	Unused Commitment
Fee Percentage


	 Equal to or higher than 1.5 to 1
	  	0.375%
	 Equal to or higher than 1.0 to 1 but lower than 1.5 to 1
	  	0.25%
	 Lower than 1.0 to 1
	  	0.20%

  
 Except during the
initial period described in clause (i) above, the Unused Commitment Fee Percentage will be automatically adjusted as of the first day of the month following receipt by the Bank of consolidated financial statements of the Borrower and its
Consolidated Subsidiaries pursuant to Section 6.01(a) or Section 6.01(b) demonstrating to the Bank’s reasonable satisfaction that there has been a change in the Total Consolidated Debt to Consolidated EBITDA Ratio which would cause a change in
the Unused Commitment Fee Percentage in accordance with the preceding table. At all times after and during the continuance of a Default with respect to the Borrower’s obligations under Section 6.01(a) or Section 6.01(b) until the delivery of
the applicable financial statements required pursuant thereto, the Unused Commitment Fee Percentage shall be 0.375%. 
  
 41. Exhibit D to the Credit Agreement is hereby deleted in its entirety and a new Exhibit, which is attached to this Second Amendment and labeled
Exhibit D-2, is substituted in its place. 
  
 42. Exhibit E
to the Credit Agreement is hereby deleted in its entirety and a new Exhibit, which is attached to this Second Amendment and labeled Exhibit E-2, is substituted in its place. 
  
 43. Exhibit F to the Credit Agreement is hereby deleted in its entirety and a new Exhibit, which is attached to this Second
Amendment and labeled Exhibit F-2, is substituted in its place. 
  









 44. Exhibit I to the Credit Agreement is hereby deleted in its entirety and a new Exhibit, which is
attached to this Second Amendment and labeled Exhibit I-2, is substituted in its place. 
  
 45. Schedule 5.05 to the Credit Agreement is hereby deleted in its entirety and a new Schedule, which is attached to this Second Amendment and labeled Schedule 5.05, is substituted in its place. 
  
 46. Schedule 5.08 to the Credit Agreement is hereby deleted in its entirety
and a new Schedule, which is attached to this Second Amendment and labeled Schedule 5.08, is substituted in its place. 
  
 47. A new schedule, Schedule 6.07(l), is hereby attached to and made a part of the Credit Agreement. 
  
 48. The Borrower hereby represents and warrants to the Bank (which
representations and warranties shall survive the execution and delivery of this Second Amendment) that: 
  
 (a) It is in compliance with all of the terms, covenants and conditions of the Credit Agreement, as amended by this Second Amendment, and
each of the other Loan Documents. 
  
 (b) There
exists no Default or Event of Default under the Credit Agreement, as amended by this Second Amendment, and no event has occurred or condition exists which, with the giving of notice or lapse of time, or both, would constitute such a Default or Event
of Default. 
  
 (c) The representations and
warranties contained in Article V of the Credit Agreement are, except to the extent that they relate solely to an earlier date or except to the extent that they relate solely to TREX LLC, true in all material respects with the same effect as though
such representations and warranties had been made on the date of this Second Amendment. 
  
 (d) The execution, delivery and performance by the Borrower of this Second Amendment and each of the new promissory notes (attached hereto
as Exhibit D-2, Exhibit E-2, Exhibit F-2 and Exhibit I-2, respectively) are within its corporate powers, have been duly authorized by all necessary corporate action, require no action by or in respect of, or filing with,
any governmental body, agency or official and do not contravene or constitute (with or without the giving of notice or lapse of time or both) a default under any provision of applicable law or of the organizational documents of the Borrower or any
Subsidiary or of any agreement, judgment, injunction, order, decree or other instrument binding upon or affecting the Borrower or any Subsidiary or result in the creation or imposition of any Lien on any asset of the Borrower or any of its
Subsidiaries. 
  









 (e) This Second Amendment and the promissory notes described in paragraph 48(d) of this
Second Amendment constitute valid and binding agreements of the Borrower, enforceable against the Borrower in accordance with their respective terms, except as such enforceability may be limited by bankruptcy, insolvency or similar laws affecting
creditors’ rights generally and by equitable principles of general applicability (regardless of whether such enforceability is considered in a proceeding in equity or at law). 
  
 (f) Except as set forth on Schedule 5.05 to the Credit Agreement, there is no material action, suit,
proceeding or investigation pending against, or to the knowledge of the Borrower threatened against, contemplated or affecting, the Borrower or any of its Subsidiaries before any court, arbitrator or governmental body, agency or official which has,
or could reasonably be expected to have, individually or in the aggregate, a Material Adverse Effect, or which in any manner draws into question the validity or enforceability of this Second Amendment, any of the promissory notes described in
paragraph 48(d) of this Second Amendment or any of the Loan Documents, and there is no basis known to the Borrower or any of its Subsidiaries for any such action, suit, proceeding or investigation. 
  
 49. The Bank’s agreement to enter into this Second Amendment is subject
to the following conditions precedent: 
  
 (a)
The Borrower shall have executed and delivered to the Bank this Second Amendment and each of the promissory notes described in paragraph 48(d) of this Second Amendment in the forms of Exhibit D-2, Exhibit E-2, Exhibit F-2 and Exhibit I-2 attached
hereto with the blanks therein appropriately completed. 
  
 (b) The Borrower shall have delivered to the Bank (i) certified copies of the resolutions of its board of directors authorizing and approving this Second Amendment and the promissory notes described in paragraph 48(d)
of this Second Amendment, (ii) a certificate of incumbency executed by the secretary of the Borrower setting forth the names of the officers of the Borrower that are authorized to execute this Second Amendment and the promissory notes described in
paragraph 48(d) of this Second Amendment, together with a specimen signature for each such officer, and (iii) such other and further documents, certificates, opinions and other papers as the Bank shall require. 
  
 (c) The Bank shall have received a favorable opinion of
counsel to the Borrower addressed to the Bank, dated as of the date hereof and satisfactory in form and substance to the Bank, as to the due authorization, execution, delivery and enforceability of this Second Amendment, the promissory notes
described in paragraph 48(d) of this Second Amendment, and such other matters as the Bank shall request. 
  
 (d) The Borrower shall have paid to the Bank in immediately available funds (i) a fee with respect to the Revolving Credit Loan in the
amount of $35,000 and (ii) a fee with respect to Real Estate Term Loan 1, Real Estate Term Loan 2 and Real Estate Term Loan 3 in the amount of $10,000, both of which fees shall be deemed fully earned and non-refundable once paid. 
  









 (e) The Borrower shall have delivered or caused to be delivered to the Bank certificates
of insurance and other evidence satisfactory in form and substance to the Bank that the Borrower is in full compliance with Section 6.03 of the Credit Agreement. 
  
 50. Upon the fulfillment of the conditions contained in paragraph 49 of this Second Amendment, the Bank agrees to execute,
deliver, file and record, as applicable, at the Borrower’s sole cost and expense (which cost and expense the Borrower hereby agrees to pay upon demand), such agreements, documents, instruments, Uniform Commercial Code financing statements and
amendments, and such other papers as the Borrower may from time to time reasonably request to evidence the termination of the Liens created by the Security Agreement in favor of the Bank as a Secured Party (as defined in the Security Agreement)
thereunder. 
  
 51. Except as expressly amended hereby, the terms
of the Credit Agreement shall remain in full force and effect in all respects, and the Borrower hereby reaffirms its obligations under the Credit Agreement, as amended by this Second Amendment, and each of the other Loan Documents. The Borrower
hereby waives any claim, cause of action, defense, counterclaim, setoff or recoupment of any kind or nature that it may assert against the Bank arising from or in connection with the Credit Agreement, as amended by this Second Amendment, any of the
Loan Documents, or the transactions contemplated thereby or hereby that exist on the date hereof or arise from facts or actions occurring prior hereto or on the date hereof. Nothing contained in this Second Amendment shall be construed to constitute
a novation with respect to the obligations described in the Credit Agreement. 
  
 52. All references to the Credit Agreement in any of the Loan Documents, or any other documents or instruments that refer to the Credit Agreement, shall be deemed to be references to the Credit Agreement as amended by
this Second Amendment. 
  
 53. This Second Amendment and each of
the promissory notes described in paragraph 48(d) of this Second Amendment shall be construed in accordance with and governed by the laws of the Commonwealth of Virginia. 
  
 54. Any Dispute arising out of or related to this Second Amendment, any of the promissory notes described in paragraph 48(d)
of this Second Amendment or any of the Loan Documents shall be resolved by binding arbitration as provided in Section 9.07 of the Credit Agreement. TO THE FULLEST EXTENT PERMITTED BY LAW, THE PARTIES HERETO HEREBY IRREVOCABLY WAIVE THEIR
RESPECTIVE RIGHTS TO A JURY TRIAL WITH RESPECT TO ANY DISPUTE. 
  
 55. This Second Amendment may be executed in any number of counterparts, each of which shall be an original, but all of which taken together shall constitute one and the same instrument. 
  
 56. This Second Amendment shall be binding upon and inure to the benefit of
the parties hereto and their respective successors and assigns. The Borrower shall not have the right to assign any of its rights or obligations under or delegate any of its duties under the Credit Agreement, as amended by this Second Amendment, or
any of the other Loan Documents. 
  









 57. The Borrower hereby agrees that it will pay on demand all out-of-pocket expenses incurred by the Bank
in connection with the preparation of this Second Amendment and any other related documents, including but not limited to the fees and disbursements of counsel for the Bank. 
  
 58. This Second Amendment and the promissory notes described in paragraph 48(d) of this Second Amendment represent the final
agreement between the Borrower and the Bank with respect to the subject matter hereof, and may not be contradicted, modified or supplemented in any way by evidence of any prior or contemporaneous written or oral agreements of the Borrower and the
Bank. 
  
 [Remainder of Page Intentionally Left Blank] 

 









 IN WITNESS WHEREOF, the Borrower and the Bank have caused this Second Amendment to be executed by
their duly authorized officers under seal as of the date first written above. 
  

					
	TREX COMPANY, INC.
			
	 By:
	 	 /s/ Paul D. Fletcher
	 	 (SEAL)

	 Name:
	 	 Paul D. Fletcher
	 	 
	 Title:
	 	 Senior Vice President and
 Chief Financial Officer
	 	 
	
	 BRANCH BANKING AND TRUST COMPANY
 OF VIRGINIA

			
	 By:
	 	 /s/ David A. Chandler
	 	 (SEAL)

	 Name:
	 	 David A. Chandler
	 	 
	 Title:
	 	 Senior Vice President
	 	 


  
 Exhibit D-2 - Promissory Note
(Real Estate Term Loan 1) 
 Exhibit E-2 - Promissory Note (Real Estate Term Loan 2) 
 Exhibit F-2 - Promissory Note (Real Estate Term Loan 3) 
 Exhibit I-2 - Promissory Note (Revolving Note) 
  
 Schedule 5.08 - Litigation 
 Schedule 5.08 - Subsidiaries 
 Schedule 6.07(l) - Existing Liens