##### 



Exhibit 10.4
 STOCK PURCHASE AGREEMENT
 DATED AS OF MAY 1, 2006
 BY AND AMONG
 COMSTOCK HOMEBUILDING COMPANIES, INC.
 CAPITOL HOMES, INC.,
 AND
 EACH OF THE SELLING SHAREHOLDERS IDENTIFIED HEREIN




---



##### 



TABLE OF CONTENTS[TO BE REVISED]
 PageARTICLE I DEFINITIONS
    
    
    11.1 Definitions
    
    
    11.2 Other Defined Terms
    
    
    81.3 Accounting Principles
    
    
    81.4 Construction
    
    
    8ARTICLE II PURCHASE AND SALE OF SHARES
    
    
    82.1 The Acquisition
    
    
    82.2 Purchase Price
    
    
    92.3 Time and Place of Closing
    
    
    11ARTICLE III REPRESENTATIONS AND WARRANTIES
    
    
    153.1 General Statement
    
    
    153.2 Representations and Warranties of Purchaser
    
    
    153.3 Representations and Warranties of the Company and Sellers
    
    
    16ARTICLE IV [Reserved]
    
    
    30ARTICLE V CONDITIONS TO CLOSING
    
    
    305.1 Conditions to the Companys and Sellers Obligations
    
    
    305.2 Conditions to Purchasers Obligations
    
    
    31ARTICLE VI CLOSING
    
    
    326.1 Form of Documents
    
    
    326.2 Purchasers Deliveries
    
    
    326.3 Companys and Sellers Deliveries
    
    
    33ARTICLE VII POST-CLOSING AGREEMENTS
    
    
    347.1 Post-Closing Agreements
    
    
    347.2 Inspection of Records
    
    
    347.3 Use of Trademarks
    
    
    357.4 Payments of Accounts Receivable
    
    
    357.5 Third Party Claims
    
    
    357.6 Further Assurances
    
    
    35ARTICLE VIII OTHER AGREEMENTS
    
    
    388.1 Confidentiality
    
    
    388.2 Publicity
    
    
    388.3 Certain Tax Matters
    
    
    388.4 Employee Matters
    
    
    398.5 Personal Guarantees
    
    
    368.6 Entry into Further Agreements
    
    
    36
 i




---



##### 



PageARTICLE IX INDEMNIFICATION
    
    
    409.1 The Companys and Sellers Indemnification Obligations
    
    
    409.2 Purchasers Indemnification Obligations
    
    
    409.3 Cooperation
    
    
    409.4 Third Party Claims
    
    
    419.5 No Contribution
    
    
    429.6 Survival of Representations and Warranties; Limitations
    
    
    409.7 Set-off
    
    
    43ARTICLE X MISCELLANEOUS
    
    
    4410.1 Notices
    
    
    4410.2 Expenses; Transfer Taxes
    
    
    4510.3 Entire Agreement
    
    
    4510.4 Non-Waiver
    
    
    4510.5 Counterparts
    
    
    4510.6 Severability
    
    
    4610.7 Applicable Law
    
    
    4610.8 Binding Effect; Benefit
    
    
    4610.9 Assignability
    
    
    4610.10 Rule of Construction
    
    
    4610.11 Waiver of Trial by Jury
    
    
    4610.12 Consent to Jurisdiction
    
    
    4710.13 Amendments
    
    
    4710.14 Headings
    
    
    47
 ii




---



##### 



Schedule 2.2.1(b)
    
    Assumed Institutional DebtSchedule 2.2.1(c)
    
    Assumed Shareholder DebtSchedule 2.2.1
    
    Percentage AllocationSchedule 3.3.5
    
    ConsentsSchedule 3.3.7
    
    Conflicts under ContractsSchedule 3.3.8
    
    Subsidiaries and AffiliatesSchedule 3.3.9
    
    Directors and OfficersSchedule 3.3.11
    
    Capitalization/Ownership of SharesSchedule 3.3.12
    
    Financial StatementsSchedule 3.3.14
    
    Liabilities; Accounts PayableSchedule 3.3.16
    
    AssetsSchedule 3.3.17
    
    Accounts ReceivableSchedule 3.3.18
    
    InsuranceSchedule 3.3.19
    
    Bank AccountsSchedule 3.3.20
    
    TaxesSchedule 3.3.21
    
    ContractsSchedule 3.3.23
    
    SuppliersSchedule 3.3.24
    
    Related Party TransactionsSchedule 3.3.25
    
    PermitsSchedule 3.3.26
    
    Benefit PlansSchedule 3.3.27
    
    Employee RelationsSchedule 3.3.28
    
    Litigation and ClaimsSchedule 3.3.29
    
    Decrees, Orders and Arbitration AwardsSchedule 3.3.31
    
    Environmental MattersSchedule 3.3.32(a)
    
    Real PropertySchedule 3.3.32(e)
    
    Leased Real EstateSchedule 3.3.33
    
    Intellectual PropertySchedule 3.3.34
    
    Product LiabilitySchedule 8.5
    
    Personal Guarantees
 iii




---



##### 



Exhibit A
    
    
    
    Form of Employment AgreementExhibit B
    
    
    
    Form of Noncompetition AgreementExhibit C
    
    
    
    Form of Land Purchase AgreementExhibit D
    
    
    
    Form of Escrow AgreementExhibit E
    
    
    
    Form of Seller ReleaseExhibit F
    
    
    
    Form of Legal Opinion
 i




---



##### 



STOCK PURCHASE AGREEMENT
 Agreement Purchaser Company Shares Common Stock Seller Sellers
      
 Definitions
 Accounts Receivable
 Affiliate
 Agreement
 Appurtenances




---



##### 



Benefit Plan
 Business Day
 CERCLA
 Claims
 Closing
 Closing Date
 Code
 Common Stock
 Company
 Comstock Shares
 Contract
 Control
 Damages
 2




---



##### 



Disclosure Schedule
 Division
 Earnout Basis
 Employment Agreement Exhibit A
 Environmental Claim
 Environmental Laws
 Environmental Permits
 ERISA
 Fair Market Value
 3




---



##### 



Financial Statements
 Fully Developed and Buildable Land
 GAAP
 Governmental or Regulatory Authority
 Ground Lease Property
 Hazardous Substances
 Improvements
 4




---



##### 



Indebtedness
 Indemnified Party
 Indemnifying Party
 Intellectual Property
 Intellectual Property Licenses
 Interim Financial Statement Date
 Interim Financial Statements
 IRS
 Law
 Land Purchase Agreements
 Leased Real Estate
 Liabilities
 Material Adverse Effect
 5




---



##### 



Neutral Accountant
 Noncompetition Agreement Exhibit B
 Permits
 Permitted Liens
 Person
 Proprietary Software
 Purchaser
 Purchaser Indemnitees
 Real Property
 Related Parties
 6




---



##### 



Release
 Returns
 Seller
 Seller Indemnitees
 Seller Representative
 Shares
 Software
 Subsidiaries
 Tax Taxes
 Third Party Claim
 Unaudited Financial Statements
 Undeveloped Land
 7




---



##### 



Undeveloped Lots
 Other Defined Terms
 Accounting Principles
 Construction
 
 The Acquisition
 8




---



##### 



Purchase Price
 Closing Payment
 Assumed Institutional Debt
 Assumed
Shareholder Debt
 Earnout Amounts
 Purchase Price
 Undeveloped Lots
  Estimated Closing Date Balance Sheet
 9




---



##### 



Interim Balance Sheet
 Closing Date Balance Sheet Dispute Notice
 Holdback
 10




---



##### 



Escrow Agent Exhibit D Escrow Agreement
 Date
    
    Maximum HoldbackMarch 31, 2007
    
    $
    1,666,666First Anniversary of Closing Date
    
    $
    1,416,666March 31, 2008
    
    $
    1,083,333Second Anniversary of Closing Date
    
    $
    333,333March 31, 2009
    
    
    -0-
  Earnout Amounts
 First
Earnout Period
 Second Earnout
Period
 11




---



##### 



Third
Earnout Period Applicable Earnout Periods
 Comstock
Shares
 Initial Earnout Basis Amount Final Earnout Basis Amount Final Earnout
Amount Determination Date
 12




---



##### 



Earnout Period Board
 Listed Equity
Securities
 Registration Covenant. Securities Act
 13




---



##### 



Transferability; Registration; Legending of Comstock Shares and Listed Equity
Securities
    14




---



##### 



Seller Representative
 
 General Statement
 Representations and Warranties of Purchaser
 Organization, Existence and Good Standing
 Power and Authority
 15




---



##### 



Enforceability
 Consents
 Conflicts Under Constituent Documents or Laws
 Brokers
 Availability of Funds
 Representations and Warranties of the Company and Sellers.
 Organization, Existence and Good Standing
 Foreign Good Standing
 16




---



##### 



Power and Authority
 Enforceability
 Consents
 Conflicts Under Constituent Documents or Laws
 Conflicts Under Contracts
 17




---



##### 



Subsidiaries, Affiliates and Related Parties
 Directors and Officers
 Constituent Documents; Books and Records
 Capitalization and Title to Shares
   18




---



##### 



Financial Statements
 Conduct of Business
       19




---



##### 



Liabilities
 Adequate Cash
 Assets
 Accounts Receivable
 Insurance
 20




---



##### 



Bank Accounts
 Taxes
    21




---



##### 



Contracts
 22




---



##### 



Material Adverse Effect
 Suppliers
 Related Parties Transactions
 23




---



##### 



Permits
 Employee Benefit Plans
      Employee Relations
  24




---



##### 



Litigation and Claims
 Decrees, Orders or Arbitration Awards
 25




---



##### 



Compliance with Laws
 Environmental Matters
 Real Property
  26




---



##### 



27




---



##### 



Intellectual Property
  28




---



##### 



Company
Intellectual Property
         Product Liability
 29




---



##### 



Commercial Bribery
 No Omissions
 Brokers
 
 
 Conditions to the Companys and Sellers Obligations
  30




---



##### 



Conditions to Purchasers Obligations
      31




---



##### 



Form of Documents
 Purchasers Deliveries
    32




---



##### 



Companys and Sellers Deliveries
       Exhibit E
     33




---



##### 



Exhibit F
  
 Post-Closing Agreements
 Inspection of Records
 34




---



##### 



Use of Trademarks
 Payments of Accounts Receivable
 Third Party Claims
 Further Assurances
 Right of First Offer.
  35




---



##### 



36




---



##### 



37




---



##### 



Confidentiality provided however
 Publicity
 Certain Tax Matters
 Tax Proceedings
 38




---



##### 



Employee Matters
 Personal Guarantees
 Entry into Further Agreements Exhibit C Land Purchase
Agreement Rex and Rex 2 Amendments
 39




---



##### 



The Companys and Sellers Indemnification Obligations
     Purchasers Indemnification Obligations
   Cooperation
 40




---



##### 



Third Party Claims provided however
    41




---



##### 



No Contribution. Each Seller hereby waives any right to contribution or any similar
rights it may have against the Company arising out of such Sellers agreement to indemnify
Purchaser pursuant to this Article IX.
 Survival of Representations and Warranties; Limitations
  Basket
 42




---



##### 



Unlimited Claims Liability
Cap
  Set-off
  43




---



##### 



Notices
  
  
  
  
   44




---



##### 



Expenses; Transfer Taxes
 Entire Agreement
 Non-Waiver
 Counterparts
 45




---



##### 



Severability
 Applicable Law
 Binding Effect; Benefit
 Assignability
 Rule of Construction
 Waiver of Trial by Jury
 11 Good-Faith Negotiations
 46




---



##### 



Consent to Jurisdiction
 Amendments
 Headings
  47




---



##### 



PURCHASER:COMSTOCK HOMEBUILDING COMPANIES, INC.By:Name:Title:THE COMPANY:CAPITOL HOMES, INC.By:Name:Title:




---



##### 



SELLERS:RICHARD
WEALEGLENN
HARTMANPABLO
REITER