**Exhibit 10.31(d)**
          

**AMENDMENT NO. 5 TO THE                                        MASTER LOAN AND SECURITY AGREEMENT**
          AMENDMENT  NO. 5, dated as of May 15,  2003  (this  “Amendment”),  to the  Amended  and  RestatedMaster  Loan and  Security  Agreement,  dated as of November  16,  2001 (as  previously  amended,  supplemented  orotherwise modified,  the “Existing Loan Agreement”,  and as amended hereby and as further amended,  supplemented orotherwise modified from time to time, the “Loan  Agreement”),  among AAMES CAPITAL  CORPORATION  (“Aames Capital”),AAMES FUNDING  CORPORATION  (“Aames Funding” and together with Aames Capital,  each a “Borrower” and  collectively,the “Borrowers”)  and MORGAN STANLEY  MORTGAGE CAPITAL INC.,  formerly known as Morgan Stanley Dean Witter MortgageCapital Inc. (the “Lender”).

**RECITALS**
          The  Borrowers  and the Lender are parties to the  Existing  Loan  Agreement.  Capitalized  termsused but not otherwise defined herein shall have the meanings given to them in the Existing Loan Agreement.

          The  Borrowers  and  the  Lender  have  agreed,  subject  to the  terms  and  conditions  of thisAmendment, that the Existing Loan Agreement be amended to extend the Termination Date.

          Accordingly,  the Borrowers and the Lender hereby agree, in  consideration of the mutual premisesand mutual obligations set forth herein, that the Existing Loan Agreement is hereby amended as follows:

          **Section 1.**  Amendment.  Section 1.01 of the Existing Loan  Agreement is hereby  amended by deleting thedefinition of “Termination Date” in its entirety and substituting in lieu thereof the following new definition:

          “‘Termination  Date’ shall mean July 15, 2003 or such earlier  date on which this Loan  Agreement         shall terminate in accordance with the provisions hereof or by operation of law.”

          **Section 2.**         Amendment  Fee.  The  Borrowers  shall pay,  jointly and  severally,  to the Lender on or prior tothe  Amendment  Effective  Date (as defined  below) an  amendment  fee in the amount set forth in the letter to theBorrowers from the Lender dated the Amendment Effective Date (the “Amendment Fee”).

          **Section 3.** Conditions  Precedent.  This  Amendment  shall be effective  as of May 15, 2003 (the  “AmendmentEffective Date”); provided that the following conditions precedent shall have been satisfied:

          3.1   Delivered  Documents.  The Lender shall have received the following  documents,  each ofwhich shall be satisfactory to the Lender in form and substance:

 

               (a)   Amendment.   This Amendment,  executed and delivered by a duly authorized  officer of each Borrower and the         Lender;

               (b)   Closing  Certificate  of  the  Borrowers.   A  certificate  of a  Responsible  Officer  of  each  Borrower,         substantially  in the form of Exhibit A hereto,  dated as of the date  hereof,  and  certifying  as to the         incumbency and specimen signature of each officer executing this Amendment;

               (c)   Amendment Fee.  The Borrower shall deliver in immediately  available funds,  without deduction,  set-off or         counterclaim, to the Lender the Amendment Fee; and

               (d)   Other Documents.   Such other documents as the Lender or counsel to the Lender may reasonably request.

          3.2   No Default.   On the Amendment  Effective  Date, (i) each Borrower shall be in compliancewith all the  terms  and  provisions  set  forth in the  Existing  Loan  Agreement  on its part to be  observed  orperformed,  (ii) the  representations  and warranties  made and restated by the Borrowers  pursuant to Section 4 ofthis  Amendment  shall be true and complete on and as of such date with the same force and effect as if made on andas of such date, and (iii) no Default shall have occurred and be continuing on such date.

          **Section 4.**         Representations  and  Warranties.  Each  Borrower  hereby  represents  and warrants to the Lenderthat it is in  compliance  with all the terms and  provisions  set  forth in the Loan  Documents  on its part to beobserved or performed,  and that no Default has occurred or is  continuing,  and hereby  confirms and reaffirms therepresentations and warranties contained in Section 6 of the Loan Agreement.

          **Section 5.** Limited Effect.   Except as expressly  amended and modified by this  Amendment,  the Existing LoanAgreement  shall  continue  to be,  and shall  remain,  in full  force and  effect in  accordance  with its  terms;provided,  however,  that reference  therein and herein to the “Loan Documents” shall be deemed to include,  in anyevent, (i) the Existing Loan Agreement,  (ii) Amendment No. 1 to the Master Loan and Security  Agreement,  dated asof November 14, 2002,  (iii)  Amendment No. 2 to the Master Loan and Security  Agreement,  dated as of November 22,2002, (iv) Amendment No. 3 to the Master Loan and Security  Agreement,  dated as of December 5, 2002, (v) AmendmentNo. 4 to the Master Loan and Security  Agreement,  dated as of February 13, 2003,  (vi) this  Amendment,  (vii) theNote,  (viii) the  Custodial  Agreement  and (ix) the  Custodial  Joinder  Agreement.  Each  reference  to the LoanAgreement  in any of the Loan  Documents  shall be deemed to be a  reference  to the  Existing  Loan  Agreement  asamended  hereby.  The  execution  of this  Amendment  by the  Lender  shall not  operate  as a waiver of any of itsrights,  powers  or  privileges  under  the Loan  Agreement  or under any of the  other  Loan  Documents  except asexpressly set forth herein.

          **Section 6.**         Counterparts. This  Amendment  may be executed  by each of the  parties  hereto on any number ofseparate  counterparts,  each of which shall be an original and all of which taken  together  shall  constitute oneand the same instrument.

 

          **Section 7.**         GOVERNING  LAW.  THIS  AMENDMENT  SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE  WITH, THE LAWOF THE STATE OF NEW YORK WITHOUT REFERENCE TO THE CHOICE OF LAW PROVISIONS THEREOF.

          

          

          

          

          

          

          

          

          

          

          

          

          

          

          

 

                            IN WITNESS  WHEREOF,  the  parties  hereto have caused this  Amendment  to be duly  executed  anddelivered as of the day and year first above written.
BORROWER     **AAMES      CAPITAL CORPORATION**           By        _____________________________          Name:        Title:   **AAMES      FUNDING CORPORATION**     By  _____________________________          Name:        Title:   LENDER   **MORGAN      STANLEY DEAN WITTER MORTGAGE CAPITAL INC**           By  __________________________           Name:                Title: