EXHIBIT 10.4.2

                    THIRD AMENDMENT TO AMENDED AND RESTATED
                      MORTGAGE LOAN WAREHOUSING AGREEMENT

          THIS THIRD AMENDMENT TO AMENDED AND RESTATED MORTGAGE LOAN WAREHOUSING
AGREEMENT (the "Amendment") is made and dated as of the 16/th/ day of January,
1998, by and among THE FIRST NATIONAL BANK OF CHICAGO, a national banking
association ("FNBC"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, a
national banking association, THE BANK OF NEW YORK, a banking corporation
organized under the laws of the State of New York, COMERICA BANK - CALIFORNIA, a
California banking corporation, FIRST UNION NATIONAL BANK, a national banking
association, and GUARANTY FEDERAL BANK, a federal savings bank (all of the above
individually a "Lender" and, collectively, the "Lenders"), FNBC, as
administrative agent for the Lenders (in such capacity, the "Administrative
Agent"), FIRST CHICAGO NATIONAL PROCESSING ASSOCIATION, a Delaware corporation,
as collateral agent for the Administrative Agent and the Lenders (in such
capacity, the "Collateral Agent"), and HEADLANDS MORTGAGE COMPANY, a California
corporation (the "Company").

                                    RECITALS

          A.  Pursuant to that certain Amended and Restated Mortgage Loan
Warehousing Agreement dated as of August 29, 1997 among the Administrative
Agent, the Collateral Agent, the Lenders and the Company (the "Agreement"), the
Lenders agreed to extend credit to the Company on the terms and subject to the
conditions set forth therein.  All capitalized terms not otherwise defined
herein shall have the meanings given to such terms in the Agreement.

          B.   The Company has requested certain temporary waivers and temporary
amendments to the Agreement and the Lenders have agreed thereto on certain
conditions, all as more particularly described below.

          NOW, THEREFORE, in consideration of the foregoing Recitals and for
other good and valuable consideration, the receipt and adequacy of which are
hereby acknowledged, the parties hereto hereby agree as follows:

                                   AGREEMENT

          1.  Temporary Waivers.  The Company has requested a waiver of
              -----------------                                        
compliance with certain financial covenants during the period from and including
the Effective Date (as defined in Paragraph 6 below) to but excluding February
13, 1998 (the "Waiver Termination Date").  The Lenders hereby waive, on a
temporary basis, compliance by the Company with the financial covenants set
forth in Paragraphs 12(j) (Total Liabilities to Effective Net Worth; Total
Liabilities to Adjusted Tangible Net Worth), 12 (l)(2) (maximum repurchase
obligations), and 12(m) (Current Ratio) during the period from and including the
Effective Date to but excluding the 

                                       1

 
Waiver Termination Date. On the Waiver Termination Date, the Company shall be
required to be back in compliance with all such financial covenants.

          2.  Temporary Amendment.  The Company has requested a temporary
              -------------------                                        
modification of its covenant for maximum Total Liabilities during the period
from and including the Effective Date to but excluding the Waiver Termination
Date.  The parties hereto hereby agree that, during the period from and
including the Effective Date to but excluding the Waiver Termination Date,
Paragraph 12(n) of the Agreement shall be amended to replace the percentage
"ninety-eight percent (98%)" in clause (2) thereof with the percentage "ninety-
nine percent (99%)" and to replace the percentage "ninety-five percent (95%)" in
clause (3) thereof with the percentage "ninety-eight percent (98%)".  On the
Waiver Termination Date, such amendments shall no longer be in effect and
Paragraph 12(n) shall read as it did immediately prior to such amendments.
 
          3.  Tranche D Borrowing Base.  The parties hereto desire to clarify
              ------------------------                                       
the method of determining the Collateral Value of the Borrowing Base consisting
of Eligible Shipped Mortgage Loans and Eligible Gestation Mortgage Loans.
Effective as of the Effective Date:
 
              (a) Subparagraph 4(a)(2) of the Agreement is hereby amended to add
the parenthetical phrase "(based upon the 7:30 a.m. (Los Angeles time)
Collateral Value Determination made by the Collateral Agent pursuant to the
Security Agreement)" immediately after the phrase "Eligible Gestation Mortgage
Loans" set forth therein.
 
              (b) Subparagraph 7(f)(2) of the Agreement is hereby amended to add
the parenthetical phrase "(based upon the 7:30 a.m. (Los Angeles time)
Collateral Value Determination made by the Collateral Agent pursuant to the
Security Agreement)" immediately after the phrase "at any date" set forth
therein.

          4.  Reaffirmation of Other Loan Documents.  The Company hereby affirms
              -------------------------------------                             
and agrees that (a) the execution and delivery by the Company of and the
performance of its obligations under this Amendment shall not in any way amend,
impair, invalidate or otherwise affect any of the obligations of the Company or
the rights of the Administrative Agent, the Collateral Agent or the Lenders
under the Agreement, the Security Agreement or any other Loan Document, (b) the
term "Obligations" as defined in Paragraph 16 of the Agreement includes, without
limitation, the Obligations of the Company under the Agreement as amended by
this Amendment, (c) the Security Agreement remains in full force and effect and
such agreement constitutes a continuing first priority security interest in and
lien upon the Collateral, and (d) for any and all purposes, any reference to the
Agreement following the effective date of this Amendment shall constitute a
reference to the Agreement as amended to date, including, without limitation, by
this Amendment.

          5.  Modification of Related Documents.  All reports and other forms
              ---------------------------------                              
utilized in connection with the day-to-day operations of the credit facility
evidenced by the Agreement shall be deemed modified consistent with the
provisions of this Amendment.

                                       2

 
          6.  Effective Date.  This Amendment shall be effective on the earliest
              --------------                                                    
date (the "Effective Date") upon which the Administrative Agent has received
duly executed copies of this Amendment from each of the Lenders, the
Administrative Agent, the Collateral Agent and the Company.

          7.  Representations and Warranties.  The Company hereby represents and
              ------------------------------                                    
warrants to the Administrative Agent and the Lenders as follows:

              (a) The Company has the corporate power and authority and the
legal right to execute, deliver and perform this Amendment and has taken all
necessary corporate action to authorize the execution, delivery and performance
of this Amendment. This Amendment has been duly executed and delivered on behalf
of the Company and constitutes the legal, valid and binding obligation of the
Company enforceable against the Company in accordance with its terms. The
execution, delivery and performance of this Amendment will not violate any
Requirement of Law or Contractual Obligation or require any consent, approval or
authorization of, or registration, declaration or filing with, any Governmental
Authority.

              (b) At and as of the date of execution hereof and at and as of the
effective date of this Amendment and both prior to and after giving effect
hereto:  (1) the representations and warranties of the Company contained in the
Loan Documents are accurate and complete in all respects, and (2) there has not
occurred an Event of Default or Potential Default.

          8.  No Other Amendment.  Except as expressly amended herein, the Loan
              ------------------                                               
Documents shall remain in full force and effect as currently written.

          9.  Counterparts.  This Amendment may be executed in any number of
              ------------                                                  
counterparts, each of which when so executed shall be deemed to be an original
and all of which when taken together shall constitute one and the same
agreement.

                                       3

 
          IN WITNESS WHEREOF, the parties hereto have caused this Amendment to
be executed as of the day and year first above written.

                                       HEADLANDS MORTGAGE COMPANY,
                                       a California corporation
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       THE FIRST NATIONAL BANK OF CHICAGO,
                                       a national banking association, as 
                                       Administrative Agent and a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       BANK OF AMERICA NATIONAL TRUST AND 
                                       SAVINGS ASSOCIATION,
                                       a national banking association, 
                                       as a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       THE BANK OF NEW YORK,
                                       a banking corporation organized under
                                       the laws of the State of New York, 
                                       as a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------

                                       4

 
                                       COMERICA BANK-CALIFORNIA,
                                       a California banking corporation, 
                                       as a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       FIRST UNION NATIONAL BANK,
                                       a national banking association, 
                                       as a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       GUARANTY FEDERAL BANK,
                                       a federal savings bank, as 
                                       a Lender
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------
        
                                       FIRST CHICAGO NATIONAL PROCESSING
                                       CORPORATION, a Delaware corporation, 
                                       as Collateral Agent
        
                                       By:
                                          ------------------------
                                       Name:
                                            ----------------------
                                       Title:
                                             ---------------------

                                       5