1
                                                                   EXHIBIT 10.65

                             QUADRAMED CORPORATION
                             GRANTOR TRUST AGREEMENT


This Grantor Trust Agreement (the "Trust Agreement") is made this 1st day of
January, 2000, by and between QUADRAMED CORPORATION (the "Company"), and
WACHOVIA BANK, N.A. (the "Trustee").

                                    RECITALS

(a)     WHEREAS, the Company (sometimes referred to as the "Employer" and
        individually as an "Employer") has adopted the nonqualified deferred
        compensation plans and arrangements listed in Exhibit A (the
        "Arrangements");

(b)     WHEREAS, the Employer has incurred or expects to incur liability under
        the terms of such Arrangements with respect to the individuals
        participating in such Arrangements (the "Participants and
        Beneficiaries");

(c)     WHEREAS, the Employers wishes to establish a Trust dated January 1,
        2000, to cover such Arrangements (the "Trust") and the Employer shall
        contribute to the Trust assets that shall be held therein, subject to
        the claims of the creditors of the Employer in the event of the
        Insolvency (as defined herein) of the Employer, until paid to
        Participants and their Beneficiaries in such manner and at such times as
        specified in the Arrangements and in this Trust Agreement;

(d)     WHEREAS, it is the intention of the parties that this Trust shall
        constitute an unfunded arrangement and shall not affect the status of
        the Arrangements as an unfunded plan maintained for the purpose of
        providing deferred compensation for a select group of management or
        highly compensated employees for purposes of Title I of the Employee
        Retirement Income Security Act of 1974; and

(e)     WHEREAS, it is the intention of the Employer to make contributions to
        the Trust to provide itself with a source of funds (the "Fund") to
        assist it in satisfying its liabilities under the Arrangements.

NOW, THEREFORE, the parties do hereby establish the Trust and agree that the
Trust shall be comprised, held and disposed of as follows:

SECTION 1.    ESTABLISHMENT OF THE TRUST

(a)     The Trust is intended to be a grantor trust, of which the Employer is
        the Grantor, within the meaning of subpart E, part I, subchapter J,
        chapter 1, subtitle A of the Internal Revenue Code of 1986, as amended,
        and shall be construed accordingly.


                                       1
   2

        The Trust is established for the benefit of the Participants and
        Beneficiaries of the Arrangements. A list of Participants and
        Beneficiaries and the Arrangements in which they participate is
        contained in Exhibit B.

(b)     The Employer shall be considered a grantor with respect to the account
        maintained under the Trust for the Employer as described in Section 9.

(c)     The Trust hereby established is irrevocable by the Employer.

(d)     The Company hereby makes the deposit described in Exhibit C which shall
        become the principal of the Trust to be held, administered and disposed
        of by the Trustee as provided in this Trust Agreement.

(e)     The principal of the Trust, and any earnings thereon, shall be held
        separate and apart from other funds of the Employer and shall be used
        exclusively for the uses and purposes of Participants and general
        creditors as herein set forth. Participants and their Beneficiaries
        shall have no preferred claim on, nor any beneficial ownership interest
        in, any assets of the Trust. Any rights created under the Arrangements
        and this Trust Agreement shall be unsecured contractual rights of
        Participants and their Beneficiaries against the Employer. Any assets
        held by the Trust in the account of the Employer will be subject to the
        claims of the general creditors of the Employer under federal and state
        law in the event the Employer is Insolvent, subject to the provisions of
        Section 3 herein.

(f)     The Trustee shall, upon direction of the Employer, establish two
        separate funds (each individually referred to as a "Benefit Fund"). One
        Benefit Fund shall be for Arrangements having a lump sum payout as
        provided under the Arrangement and the other Benefit Fund shall be for
        all other arrangements. Prior to a Change in Control, the Trustee shall,
        upon direction, create in the Benefit Funds separate accounts (each
        individually referred to as an "Account").

(g)     The Employer, in its sole discretion, may at any time, or from time to
        time, make deposits of cash or other property acceptable to the Trustee
        in the Trust to augment the principal to be held, administered and
        disposed of by the Trustee as provided in this Trust Agreement. When
        making such deposits, the Employer shall certify the Benefit Fund or
        Funds to which such deposits shall be allocated and the Trustee shall
        allocate the contributions accordingly. Further, the Employer may direct
        the Trustee, prior to a Change in Control, the amount of deposits being
        made with respect to each Account of each Participant and the Trustee
        shall allocate the deposits among the Accounts accordingly. Prior to a
        Change in Control, neither the Trustee nor any Participant or
        Beneficiary shall have any right to compel additional deposits.

(h)     Upon a Threatened Change in Control, the Company shall, as soon as
        possible, but in no event longer than thirty (30) days following the
        occurrence of a


                                       2
   3

        Threatened Change in Control, as defined herein, make a contribution to
        the Trust in an amount that is sufficient to fund the Trust in an amount
        equal to no less than 100% but no more than 120% (in addition to
        $125,000 to fund an expense reserve for the Trustee) of the amount
        necessary to pay each Participant or Beneficiary the benefits to which
        Participants or their Beneficiaries would be entitled pursuant to the
        terms of the Arrangements as of the date on which the Threatened Change
        in Control occurred.

(i)     In the event a Change in Control does not occur within six (6) months of
        a Threatened Change in Control, the Company shall have the right, upon
        direction, to recover any amounts contributed to and remaining on hand
        in the Trust pursuant to Section 1(h)).

(j)     Upon a Change in Control, the Company shall, as soon as possible, but in
        no event longer than thirty (30) days following the occurrence of a
        Change in Control, as defined herein, make an irrevocable contribution
        to the Trust in an amount that is sufficient to fund the Trust in an
        amount equal to no less than 100 % but no more than 120% of the amount
        necessary to pay each Participant or Beneficiary the benefits to which
        Participants or their Beneficiaries would be entitled pursuant to the
        terms of the Arrangements as of the date on which the Change in Control
        occurred. The Company shall also fund an expense reserve for the Trustee
        in the amount of $125,000.00 unless such amount was previously funded
        pursuant to Section 1(h) above and not recovered pursuant to Section 1
        (i) above.

SECTION 2.     PAYMENTS TO PARTICIPANTS AND THEIR BENEFICIARIES

(a)     Prior to a Change in Control, distributions from the Trust shall be made
        by the Trustee to Participants and Beneficiaries at the direction of the
        Employer. The entitlement of a Participant or his or her Beneficiaries
        to benefits under the Arrangements shall be determined by the Employer
        or such party or professional administrator as it shall designate under
        the Arrangements as the Employer's agent, and any claim for such
        benefits shall be considered and reviewed under the procedures set out
        in the Arrangements.

(b)     Notwithstanding Section 2(a) above, a Participant or his or
        Beneficiaries may make application to the Trustee for payment of their
        benefit in the event he believes a Failure to Pay, as defined in Section
        16, has occurred. In the event that the Trustee determines that a
        Failure to Pay has occurred, it shall make its own independent
        determination of the benefit which is payable to the Participant or
        Beneficiary. Upon reaching its determination, the Trustee shall pay the
        benefit, if any, which it has determined is due the Participant or
        Beneficiary.

(c)     The Employer may make payment of benefits directly to Participants or
        their Beneficiaries as they become due under the terms of the
        Arrangements. The

                                       3
   4

        Employer shall notify the Trustee of its decision to make payment of
        benefits directly prior to the time amounts are payable to Participants
        or their Beneficiaries. In addition, if the principal of the Trust, and
        any earnings thereon, are not sufficient to make payments of benefits in
        accordance with the terms of the Arrangements, the Employer shall make
        the balance of each such payment as it falls due in accordance with the
        Arrangements. The Trustee shall notify the Employer where principal and
        earnings are not sufficient. Nothing in this Agreement shall relieve the
        Employer of its liabilities to pay benefits due under the Arrangements
        except to the extent such liabilities are met by application of assets
        of the Trust.

(d)     To the extent there remains an amount credited to a Benefit Fund after
        the benefits with respect to which such Benefit Fund was established
        have been paid in full, such excess shall be reallocated to the
        remaining Benefit Funds, if any, as of the end of the calendar quarter
        in which the last payment from such Benefit Fund was made, in proportion
        to the respective Benefit Fund balances.

        If Individual Accounts have been established within a Benefit Fund, to
        the extent there remains an amount credited to a Participant's Account
        after the Benefit with respect to which such Account was established has
        been paid in full, such excess shall be reallocated to the remaining
        Accounts of the Participant, if any. If no Account remains for such
        Participant, the excess shall be reallocated to the Accounts of all
        other Participants, as of the end of the calendar quarter in which the
        last payment to such Participant was made, in proportion to the
        respective Account balances.

        After all the benefits payable to all Participants pursuant to the
        Payment Schedules have been paid in full, the remaining Trust property,
        if any, shall upon written certification by each person entitled to
        receive the last Payment Schedule that all Benefits due to such person
        and funded within the Trust have been paid, be returned to the Company.
        Prior to the return of such assets, the Trustee may deduct its fees and
        expenses.

(e)     It is the intention of the Company to have each Benefit Fund and each
        Account, if any, established hereunder treated as a separate account
        designed to satisfy the Company's legal liability under the applicable
        Agreement in respect of the Participant or Participants for whom such
        Benefit Fund has been established, or the Participant for whom such
        Account has been established, as the case may be, and to have the
        balance, if any, in each Benefit Fund or Account, as the case may be,
        revert to the Company only after all of the Company's legal liabilities
        (including but not limited to the expenses of this Trust) with respect
        to Benefits payable to all Participants have been met. The Company
        agrees that all income, deductions and credits of the Trust Fund (or, if
        applicable, the Accounts) belong to it as owner for income tax purposes
        and will be included on the Company's income tax returns.

                                       4
   5

(f)     After a Threatened Change in Control and before a Change in Control, the
        Company shall deliver to the Trustee a schedule of benefits due under
        the Arrangements ("Payment Schedule"). Subsequent to a Change in
        Control, the Trustee shall pay benefits, subject to the terms of this
        Trust Agreement and the applicable underlying Plan, due in accordance
        with such schedule. After a Change in Control, the Employer shall
        continue to make the determination of benefits due to Participants or
        their Beneficiaries and shall provide the Trustee with an updated
        schedule of benefits due; provided however, a Participant or their
        Beneficiaries may make application to the Trustee for an independent
        decision as to the amount or form of their benefits due under the
        Arrangements.

(g)     In making any determination required or permitted to be made by the
        Trustee under this Section 2, the Trustee shall, in each such case,
        reach its own independent determination, in its absolute and sole
        discretion, as to the Participant's or Beneficiary's entitlement to a
        payment hereunder. In making its determination, the Trustee may consult
        with and make such inquiries of such persons, including the Participant
        or Beneficiary, the Employer, legal counsel, actuaries or other persons,
        as the Trustee may reasonably deem necessary. Any reasonable costs
        incurred by the Trustee in arriving at its determination shall be
        reimbursed by the Employer and, to the extent not paid by the Employer
        within a reasonable time, shall be charged to the Trust. The Employer
        waives any right to contest any amount paid over by the Trustee
        hereunder pursuant to a good faith determination made by the Trustee
        notwithstanding any claim by or on behalf of the Employer (absent a
        manifest abuse of discretion by the Trustee) that such payments should
        not be made.

(h)     The Trustee agrees that it will not itself institute any action at law
        or at equity, whether in the nature of an accounting, interpleading
        action, request for a declaratory judgment or otherwise, requesting a
        court or administrative or quasi-judicial body to make the determination
        required to be made by the Trustee under this Section 2 in the place and
        stead of the Trustee. The Trustee may, in its discretion, institute an
        action to collect a contribution due the Trust following a Change in
        Control or in the event that the Trust should ever experience a
        short-fall in the amount of assets necessary to make payments pursuant
        to the terms of the Arrangements.

(i)     In the event any Participant or his or her Beneficiary is determined to
        be subject to federal income tax on any amount to the credit of his or
        her account under any Arrangement prior to the time of payment
        hereunder, whether or not due to the establishment of or contributions
        to this Trust, a portion of such taxable amount equal to the federal,
        state and local taxes (excluding any interest or penalties) owed on such
        taxable amount, shall be distributed by the Trustee as soon thereafter
        as practicable to such Participant or Beneficiary. The Employer shall
        promptly reimburse the Trust for any such distribution in an amount
        certified by

                                       5
   6

        the Trustee to be needed for the Participant's benefits. For these
        purposes, a Participant or Beneficiary shall be deemed to pay state and
        local taxes at the highest marginal rate of taxation in the state in
        which the Participant resides or is employed (or both) where a tax is
        imposed and federal income taxes at the highest marginal rate of
        taxation, net of the maximum reduction in federal income taxes which
        could be obtained from deduction of such state and local taxes. Such
        distributions shall be at the direction of the Employer or the Trustee,
        or upon proper application of the Participant or Beneficiary; provided,
        that the actual amount of the distribution shall be determined by the
        Employer prior to a Change in Control and the Trustee following a Change
        in Control. An amount to the credit of a Participant's Account shall be
        determined to be subject to federal income tax upon the earliest of: (a)
        a final determination by the United States Internal Revenue Service
        addressed to the Participant or his Beneficiary which is not appealed to
        the courts; (b) a final determination by the United States Tax Court or
        any other federal court affirming any such determination by the Internal
        Revenue Service; or (c) an opinion by the Employer's tax counsel,
        addressed to the Employer and the Trustee, to the effect that by reason
        of Treasury Regulations, amendments to the Internal Revenue Code,
        published Internal Revenue Service rulings, court decisions or other
        substantial precedent, amounts to the credit of Participants hereunder
        are subject to federal income tax prior to payment. The Employer shall
        undertake at its sole expense to defend any tax claims described herein
        which are asserted by the Internal Revenue Service against any
        Participant or Beneficiary, including attorney fees and cost of appeal,
        and shall have the sole authority to determine whether or not to appeal
        any determination made by the Service or by a lower court. The Employer
        also agrees to reimburse any Participant or Beneficiary for any interest
        or penalties in respect of tax claims hereunder upon receipt of
        documentation of same. Any distributions from the Fund to a Participant
        or Beneficiary under this Section 2(e) shall be applied in accordance
        with the provisions of the Arrangement to reduce the Employer
        liabilities to such Participant and/or Beneficiary under the Arrangement
        with such reductions to be made on a pro-rata basis over the term of
        benefit payments under the Arrangement; provided, however, that in no
        event shall any Participant, Beneficiary or estate of any Participant or
        Beneficiary have any obligation to return all or any part of such
        distribution to the Employer if such distribution exceeds benefits
        payable under an Arrangement. Any reduction in accordance with the
        foregoing sentence and the Arrangements shall be determined by the
        Employer prior to a Change in Control . Following a Change in Control,
        the Employer shall continue to make such determination subject to the
        right of a Participant to petition the Trustee under Section 2(b).


SECTION 3.     TRUSTEE RESPONSIBILITY REGARDING PAYMENTS TO THE TRUST
               BENEFICIARY WHEN THE EMPLOYER IS INSOLVENT

                                       6
   7

(a)     The Trustee shall cease payment of benefits to Participants and their
        Beneficiaries if the Employer is Insolvent. The Employer shall be
        considered "Insolvent" for purposes of this Trust Agreement if (i) the
        Employer is unable to pay its debts as they become due, or (ii) the
        Employer is subject to a pending proceeding as a debtor under the United
        States Bankruptcy Code.

(b)     At all times during the continuance of this Trust, except to the extent
        assets of the Trust have been pledged to secure loans to the Trust, the
        principal and income of the Trust shall be subject to claims of general
        creditors of the Employer under federal and state law as set forth
        below:

        (1)    The Board of Directors and the Chief Executive Officer of the
               Employer shall have the duty to inform the Trustee in writing
               that the Employer is Insolvent. If a person claiming to be a
               creditor of the Employer alleges in writing to the Trustee that
               the Employer has become Insolvent, the Trustee shall determine in
               its sole and absolute discretion whether the Employer is
               Insolvent and, pending such determination, the Trustee shall
               discontinue payment of benefits to Participants or their
               Beneficiaries.

        (2)    Unless the Trustee has actual knowledge that the Employer is
               Insolvent, or has received notice from the Employer or a person
               claiming to be a creditor alleging that the Employer is
               Insolvent, the Trustee shall have no duty to inquire whether the
               Employer is Insolvent. The Trustee may in all events rely on
               such evidence concerning the Employer's solvency as may be
               furnished to the Trustee and that provides the Trusteewith a
               reasonable basis for making a determination concerning the
               Employer's solvency.

        (3)    If at any time the Trustee has determined that the Employer is
               Insolvent, the Trustee shall discontinue payments to Participants
               or their Beneficiaries and shall hold the assets of the Trust for
               the benefit of the Employer's general creditors. Nothing in this
               Trust Agreement shall in any way diminish any rights of
               Participants or their Beneficiaries to pursue their rights as
               general creditors of the Employer with respect to benefits due
               under the Arrangements or otherwise.

        (4)    The Trustee shall resume the payment of benefits to Participants
               or their Beneficiaries in accordance with Section 2 of this Trust
               Agreement only after the Trustee has determined that the Employer
               is not Insolvent (or is no longer Insolvent).

(c)     Provided that there are sufficient assets, if the Trustee discontinues
        the payment of benefits from the Trust pursuant to Section 3(b) hereof
        and subsequently resumes


                                       7
   8

        such payments, the first payment following such discontinuance shall
        include the aggregate amount of all payments due to Participants or
        their Beneficiaries under the terms of the Arrangements for the period
        of such discontinuance plus earnings on the amounts which were not paid
        less the aggregate amount of any payments made to Participants or their
        Beneficiaries by the Employer in lieu of the payments provided for
        hereunder during any such period of discontinuance.

SECTION 4.     PAYMENTS WHEN A SHORT-FALL OF THE TRUST ASSETS OCCURS

(a)     If there are not sufficient assets for the payment of benefits pursuant
        to Section 2 or Section 3(c) hereof and the Employer does not otherwise
        make such payments within a reasonable time after demand from the
        Trustee, the Trustee shall make payment of benefits from the Trust to
        the Participants or their Beneficiaries pro-rata except to the extent
        that the Trustee has been instructed to establish an Account pursuant to
        Section 2.

(b)     Upon receipt of a contribution from the Employer necessary to make up
        for a short-fall in the payments due, the Trustee shall resume payments
        to all the Participants and Beneficiaries under the Arrangements.
        Following a Change in Control, the Trustee shall have the right, in its
        discretion, to compel a contribution to the Trust from the Employer to
        make-up for any short-fall.

SECTION 5.     PAYMENTS TO THE EMPLOYER

Except as may otherwise be provided by this Trust, the Employer shall have no
right or power to direct the Trustee to return to the Employer or to divert to
others any of the Trust assets before all payment of benefits have been made to
Participants and their Beneficiaries pursuant to the terms of the Arrangements.

SECTION 6.     INVESTMENT AUTHORITY

(a)     The Trustee shall not be liable in discharging its duties hereunder,
        including without limitation its duty to invest and reinvest the Fund,
        if it acts for the exclusive benefit of the Participants and their
        Beneficiaries, in good faith and as a prudent person would act in
        accomplishing a similar task and in accordance with the terms of this
        Trust Agreement and any applicable federal or state laws, rules or
        regulations.

(b)     Subject to investment guidelines agreed to in writing from time to time
        by the Company and the Trustee prior to a Change in Control, the Trustee
        shall have the power in investing and reinvesting the Fund in its sole
        discretion:

        (1)    To invest and reinvest in any readily marketable common and
               preferred stocks, bonds, notes, debentures (including convertible
               stocks and securities, and including stock and securities of the
               Company, but not


                                       8
   9

               including any stock or security of the Trustee other than a de
               minimis amount held in a collective or mutual fund),
               certificates of deposit or demand or time deposits (including
               any such deposits with the Trustee) and shares of investment
               companies and mutual funds, including any proprietary mutual
               funds of the Trustee, without being limited to the classes or
               property in which the Trustees are authorized to invest by any
               law or any rule of court of any state and without regard to the
               proportion any such property may bear to the entire amount of
               the Fund;

        (2)    To commingle for investment purposes all or any portion of the
               Fund with assets of any other similar trust or trusts
               established by the Company with the Trustee for the purpose of
               safeguarding deferred compensation or retirement income benefits
               of its employees and/or directors;

        (3)    To retain any property at any time received by the Trustee;

        (4)    To sell or exchange any property held by it at public or private
               sale, for cash or on credit, to grant and exercise options for
               the purchase or exchange thereof, to exercise all conversion or
               subscription rights pertaining to any such property and to enter
               into any covenant or agreement to purchase any property in the
               future;

        (5)    To participate in any plan of reorganization, consolidation,
               merger, combination, liquidation or other similar plan relating
               to property held by it and to consent to or oppose any such plan
               or any action thereunder or any contract, lease, mortgage,
               purchase, sale or other action by any person;

        (6)    To deposit any property held by it with any protective,
               reorganization or similar committee, to delegate discretionary
               power thereto, and to pay part of the expenses and compensation
               thereof any assessments levied with respect to any such property
               to deposited;

        (7)    To extend the time of payment of any obligation held by it;

        (8)    To hold uninvested any moneys received by it, without liability
               for interest thereon, but only in anticipation of payments due
               for investments, reinvestments, expenses or disbursements;

        (9)    To exercise all voting or other rights with respect to any
               property held by it and to grant proxies, discretionary or
               otherwise;

        (10)   For the purposes of the Trust, to borrow money from a bank,
               including Wachovia Bank, N.A. or an affiliated bank, to issue its
               promissory note or notes therefor, and to secure the repayment
               thereof by pledging any property(including but not limited to any
               insurance policies)held by it;

                                       9
   10


        (11)   To employ and rely upon suitable contractors and counsel, who may
               be counsel to the Company or to the Trustee, and to pay their
               reasonable expenses and compensation from the Fund to the extent
               not paid by the Company;

        (12)   To register investments in its own name or in the name of a
               nominee; to hold any investment in bearer form; and to combine
               certificates representing securities with certificates of the
               same issue held by it in other fiduciary capacities or to deposit
               or to arrange for the deposit of such securities with any
               depository, even though, when so deposited, such securities may
               be held in the name of the nominee of such depository with other
               securities deposited therewith by other persons, or to deposit or
               to arrange for the deposit of any securities issued or guaranteed
               by the United States government, or any agency or instrumentality
               thereof, including securities evidenced by book entries rather
               than by certificates, with the United States Department of the
               Treasury or a Federal Reserve Bank, even though, when so
               deposited, such securities may not be held separate from
               securities deposited therein by other persons; provided, however,
               that no securities held in the Fund shall be deposited with the
               United States Department of the Treasury or a Federal Reserve
               Bank or other depository in the same account as any individual
               property of the Trustee, and provided, further, that the books
               and records of the Trustee shall at all times show that all such
               securities are part of the Trust Fund;

        (13)   To settle, compromise or submit to arbitration any claims, debts
               or damages due or owing to or from the Trust, respectively, to
               commence or defend suits or legal proceedings to protect any
               interest of the Trust, and to represent the Trust in all suits or
               legal proceedings in any court or before any other body or
               tribunal; provided, however, that the Trustee shall not be
               required to take any such action unless it shall have been
               indemnified by the Company to its reasonable satisfaction against
               liability or expenses it might incur therefrom;

        (14)   To hold and retain policies of life insurance, annuity contracts,
               and other property of any kind which policies are contributed to
               the Trust by the Employer or are purchased by the Trustee;


        (15)   To hold any other class of assets which may be contributed by the
               Employer and that is deemed reasonable by the Trustee, unless
               expressly prohibited herein; and

        (16)   Generally, to do all acts, whether or not expressly authorized,
               that the Trustee may deem necessary or desirable for the
               protection of the Fund.

                                       10
   11


(c)     Prior to a Change in Control, the Company shall have the right, subject
        to this Section 6, to direct the Trustee with respect to investments.

        (1)    The Company may at any time direct the Trustee to segregate all
               or a portion of the Fund in a separate investment account or
               accounts and may appoint one or more investment managers and/or
               an investment committee established by the Company to direct the
               investment and reinvestment of each such investment account or
               accounts. In such event, the Company shall notify the Trustee of
               the appointment of each such investment manager and/or
               investment committee. No such investment manager shall be
               related, directly or indirectly, to the Company, but members of
               the investment committee may be employees of the Company.

        (2)    Thereafter, the Trustee shall make every sale or investment with
               respect to such investment account as directed in writing by the
               investment manager or investment committee. It shall be the duty
               of the Trustee to act strictly in accordance with each direction.
               The Trustee shall be under no duty to question any such direction
               of the investment manager or investment committee, to review any
               securities or other property held in such investment account or
               accounts acquired by it pursuant to such directions or to make
               any recommendations to the investment managers or investment
               committee with respect to such securities or other property.

        (3)    Notwithstanding the foregoing, the Trustee, without obtaining
               prior approval or direction from an investment manager or
               investment committee, shall invest cash balances held by it from
               time to time in short term cash equivalents including, but not
               limited to, through the medium of any short term mutual fund
               established and maintained by the Trustee subject to the
               instrument establishing such trust fund, U.S. Treasury Bills,
               commercial paper (including such forms of commercial paper as
               may be available through the Trustee's Trust Department),
               certificates of deposit (including certificates issued by the
               Trustee in its separate corporate capacity), and similar type
               securities, with a maturity not to exceed one year; and,
               furthermore, sell such short term investments as may be
               necessary to carry out the instructions of an investment manager
               or investment committee regarding more permanent type investment
               and directed distributions.

        (4)    The Trustee shall neither be liable nor responsible for any loss
               resulting to the Fund by reason of any sale or purchase of an
               investment directed by an investment manager or investment
               committee nor by reason of the failure to take any action with
               respect to any investment which was acquired pursuant to any such
               direction in the absence of further directions of such investment
               manager or investment committee.

                                       11
   12

        (5)     Notwithstanding anything in this Agreement to the contrary, the
                Trustee shall be indemnified and saved harmless by the Company
                from and against any and all personal liability to which the
                Trustee may be subjected by carrying out any directions of an
                investment manager or investment committee issued pursuant
                hereto or for failure to act in the absence of directions of the
                investment manager or investment committee including all
                expenses reasonably incurred in its defense in the event the
                Company fails to provide such defense; provided, however, the
                Trustee shall not be so indemnified if it participates knowingly
                in, or knowingly undertakes to conceal, an act or omission of an
                investment manager or investment committee, having actual
                knowledge that such act or omission is a breach of a fiduciary
                duty; provided further, however, that the Trustee shall not be
                deemed to have knowingly participated in or knowingly undertaken
                to conceal an act or omission of an investment manager or
                investment committee with knowledge that such act or omission
                was a breach of fiduciary duty by merely complying with
                directions of an investment manager or investment committee or
                for failure to act in the absence of directions of an investment
                manager or investment committee. The Trustee may rely upon any
                order, certificate, notice, direction or other documentary
                confirmation purporting to have been issued by the investment
                manager or investment committee which the Trustee believes to be
                genuine and to have been issued by the investment manager or
                investment committee. The Trustee shall not be charged with
                knowledge of the termination of the appointment of any
                investment manager or investment committee until it receives
                written notice thereof from the Company.

(d)     Following a Change in Control, the Trustee shall have the sole and
        absolute discretion in the management of the Trust assets and shall have
        all the powers set forth under Section 6(b) and (c). In investing the
        Trust assets, the Trustee shall consider:

        (1)     the needs of the Arrangements;

        (2)     the need for matching of the Trust assets with the liabilities
                of the Arrangements; and

        (3)     the duty of the Trustee to act solely in the best interests of
                the Participants and their Beneficiaries.

(e)     The Trustee shall have the right, in its sole discretion, to delegate
        its investment responsibility to an investment manager who may be an
        affiliate of the Trustee. In the event the Trustee shall exercise this
        right, the Trustee shall remain, at all times responsible for the acts
        of an


                                       12
   13

        investment manager. The Trustee shall have the right to purchase an
        insurance policy or an annuity to fund the benefits of the Arrangements.

(f)     The Employer shall have the right at any time, and from time to time in
        its sole discretion, to substitute assets of equal fair market value for
        any asset held by the Trust. This right is exercisable by the Employer
        in a nonfiduciary capacity without the approval or consent of any person
        in a fiduciary capacity.

SECTION 7.     INSURANCE CONTRACTS

(a)     Prior to a Change in Control, the Company may direct the Trustee to
        invest Trust assets in an insurance contract or may, in its discretion,
        contribute insurance policies to the Trust. To the extent that the
        Trustee is directed by the Company prior to a Change in Control to
        invest part or all of the Trust Fund in insurance contracts, the type
        and amount thereof shall be specified by the Company. The Trustee shall
        be under no duty to make inquiry as to the propriety of the type or
        amount so specified.

(b)     Each insurance contract issued shall provide that the Trustee shall be
        the owner thereof with the power to exercise all rights, privileges,
        options and elections granted by or permitted under such contract or
        under the rules of the insurer. The exercise by the Trustee of any
        incidents of ownership under any contract shall, prior to a Change in
        Control, be subject to the direction of the Company. After a Change in
        Control, the Trustee shall have all such rights.

(c)     The Trustee shall have no power to name a beneficiary of the policy
        other than the Trust, to assign the policy (as distinct from conversion
        of the policy to a different form) other than to a successor Trustee, or
        to loan to any person the proceeds of any borrowing against an insurance
        policy held in the Trust Fund.

(d)     No insurer shall be deemed to be a party to the Trust and an insurer's
        obligations shall be measured and determined solely by the terms of
        contracts and other agreements executed by the insurer.

SECTION 8.     DISPOSITION OF INCOME

All income received by the Trust, net of expenses and taxes, shall be
accumulated and reinvested within the Trust.

SECTION 9.     ACCOUNTING BY THE TRUSTEE

The Trustee shall keep accurate and detailed records of all investments,
receipts, disbursements, and all other transactions required to be made,
including such specific records as shall be agreed upon in writing between the
Company and the Trustee within

                                       13
   14

forty-five (45) days following the close of each calendar year and within
forty-five (45) days after the removal or resignation of the Trustee. The
Trustee shall deliver to the Company a written account of its administration of
the Trust during such year or during the period from the close of the last
preceding year to the date of such removal or resignation setting forth all
investments, receipts, disbursements and other transactions effected by it,
including a description of all securities and investments purchased and sold
with the cost or net proceeds of such purchases or sales (accrued interest paid
or receivable being shown separately), and showing all cash, securities and
other property held in the Trust at the end of such year or as of the date of
such removal or resignation, as the case may be. The Company may approve such
account by an instrument in writing delivered to the Trustee.
In the absence of the Company's filing with the Trustee objections to any such
account within ninety (90) days after its receipt, the Company shall be deemed
to have so approved such account. In such case, or upon the written approval by
the Company of any such account, the Trustee shall, to the extent permitted by
law, be discharged from all liability to the Company for its acts or failures to
act described by such account. The foregoing, however, shall not preclude the
Trustee from having its accounting settled by a court of competent jurisdiction.
The Trustee shall be entitled to hold and to commingle the assets of the Trust
in one Fund for investment purposes, but, at the direction of the Company prior
to a Change in Control, the Trustee shall maintain an account in the name of the
Employer, Arrangement or Participant, which pursuant to the rules established by
the Company, will reflect:

(a)     deposits made by the Employer pursuant to this Trust Agreement for the
        benefit of an Arrangement or Participant;

(b)     income, losses, and appreciation or depreciation in the value of trust
        assets resulting from investment of the trust fund to the extent such
        items are attributable to the Employer's deposits as provided herein;

(c)     payments made from the Trust to Participants employed or formerly
        employed by the Employer (or to their Beneficiaries) in the form of
        benefits payable to them under the Arrangement, or to the Employer's
        creditors; and

(d)     any other amounts charged to the Employer's account, including its share
        of compensation and expenses described in Section 11.

In making the payments required by the Trustee under Sections 2, 3 and 4 hereof,
the Trustee shall not be permitted to invade an Account established pursuant to
this Section 9 to pay benefits due under another Arrangement or to another
Participant until all benefits due which are attributable to the Account have
been paid in full.

SECTION 10.    RESPONSIBILITY OF THE TRUSTEE

                                       14
   15

(a)     The Trustee shall act with the care, skill, prudence and diligence under
        the circumstances then prevailing that a prudent person acting in like
        capacity and familiar with such matters would use in the conduct of an
        enterprise of a like character and with like aims, provided, however,
        that the Trustee shall incur no liability to any person for any action
        taken pursuant to a direction, request or approval given by the Company
        which is contemplated by, and in conformity with, the terms of the
        Arrangements or this Trust and is given in writing by the Company. In
        the event of a dispute between the Company and a party, the Trustee may
        apply to a court of competent jurisdiction to resolve the dispute,
        subject, however to Section 2(d) hereof.

(b)     The Company hereby indemnifies the Trustee against losses, liabilities,
        claims, costs and expenses in connection with the administration of the
        Trust, unless resulting from the negligence or misconduct of Trustee. To
        the extent the Company fails to make any payment on account of an
        indemnity provided in this Section 10(b), in a reasonably timely manner,
        the Trustee may obtain payment from the Trust. If the Trustee undertakes
        or defends any litigation arising in connection with this Trust or to
        protect a Participant's or Beneficiary's rights under the Arrangements,
        the Company agrees to indemnify the Trustee against the Trustee's costs,
        reasonable expenses and liabilities (including, without limitation,
        attorneys' fees and expenses) relating thereto and to be primarily
        liable for such payments. If the Company does not pay such costs,
        expenses and liabilities in a reasonably timely manner, the Trustee may
        obtain payment from the Trust.

(c)     Prior to a Change in Control, the Trustee may consult with legal counsel
        (who may also be counsel for the Company generally) with respect to any
        of its duties or obligations hereunder. Following a Change in Control
        the Trustee shall select independent legal counsel and may consult with
        counsel or other persons with respect to its duties and with respect to
        the rights of Participants or their Beneficiaries under the
        Arrangements.

(d)     The Trustee may hire agents, accountants, actuaries, investment
        advisors, financial consultants or other professionals to assist it in
        performing any of its duties or obligations hereunder and may rely on
        any determinations made by such agents and information provided to it by
        the Company.

(e)     To furnish the employers with such information in the Trustee's
        possession as the Company may need or desire for tax or other purposes.

(f)     The Trustee shall have, without exclusion, all powers conferred on the
        Trustee by applicable law, unless expressly provided otherwise herein.

(g)     Notwithstanding any powers granted to the Trustee pursuant to this Trust
        Agreement or to applicable law, the Trustee shall not have any power
        that could give this Trust the objective of carrying on a business and
        dividing the gains

                                       15
   16

        therefrom, within the meaning of section 301.7701-2 of the Procedure and
        Administrative Regulations promulgated pursuant to the Internal Revenue
        Code.

SECTION 11.    COMPENSATION AND EXPENSES OF THE TRUSTEE

The Trustee's compensation shall be as agreed in writing from time to time by
the Company and the Trustee. The Company shall pay all administrative expenses
and the Trustee's fees and shall promptly reimburse the Trustee for any fees and
expenses of its agents. If not so paid, the fees and expenses shall be paid from
the Trust.

SECTION 12.    RESIGNATION AND REMOVAL OF THE TRUSTEE

(a)     Prior to a Change in Control, the Trustee may resign at any time by
        written notice to the Company, which shall be effective sixty (60) days
        after receipt of such notice unless the Company and the Trustee agree
        otherwise. Following a Change in Control, the Trustee may resign only
        after the appointment of a successor Trustee or as provided by Section
        12(c) below.

(b)     The Trustee may be removed by the Company on sixty days (60) days notice
        or upon shorter notice accepted by the Trustee prior to a Change in
        Control. Subsequent to a Change in Control, the Trustee may only be
        removed by the Company with the consent of a two-thirds majority of the
        Participants.

(c)     If the Trustee resigns within two years after a Change in Control, as
        defined herein, the Company, or if the Company fails to act within a
        reasonable period of time following such resignation, the Trustee shall
        apply to a court of competent jurisdiction for the appointment of a
        successor Trustee or for instructions.

(d)     Upon resignation or removal of the Trustee and appointment of a
        successor Trustee, all assets shall subsequently be transferred to the
        successor Trustee. The transfer shall be completed within sixty (60)
        days after the resignation, removal or transfer, unless the Company
        extends the time limit.

(e)     If the Trustee resigns or is removed, a successor shall be appointed by
        the Company, in accordance with Section 13 hereof, by the effective date
        of resignation or removal under paragraph(s) (a) or (b) of this section.
        If no such appointment has been made, the Trustee may apply to a court
        of competent jurisdiction for appointment of a successor or for
        instructions. All expenses of the Trustee in connection with the
        proceeding shall be allowed as administrative expenses of the Trust.

                                       16
   17

SECTION 13.     APPOINTMENT OF SUCCESSOR

(a)     If the Trustee resigns or is removed in accordance with Section 12
        hereof, the Company may appoint, subject to Section 12, any third party
        national banking association with a market capitalization exceeding
        $1,000,000,000 to replace the Trustee upon resignation or removal. The
        successor Trustee shall have all of the rights and powers of the former
        Trustee, including ownership rights in the Trust. The former Trustee
        shall execute any instrument necessary or reasonably requested by the
        Company or the successor Trustee to evidence the transfer.

(b)     The successor Trustee need not examine the records and acts of any prior
        Trustee and may retain or dispose of existing Trust assets, subject to
        Section 8 and 9 hereof. The successor Trustee shall not be responsible
        for and the Company shall indemnify and defend the successor Trustee
        from any claim or liability resulting from any action or inaction of any
        prior Trustee or from any other past event, or any condition existing at
        the time it becomes successor Trustee.

SECTION 14.     AMENDMENT OR TERMINATION

(a)     This Trust Agreement may be amended by a written instrument executed by
        the Trustee and the Company. Notwithstanding the foregoing, no such
        amendment shall conflict with the terms of the Arrangements or shall
        make the Trust revocable.

(b)     The Trust shall not terminate until the date on which Participants and
        their Beneficiaries have received all of the benefits due to them under
        the terms and conditions of the Arrangements.

(c)     Upon written approval of all Participants or Beneficiaries entitled to
        payment of benefits pursuant to the terms of the Arrangements, the
        Company may terminate this Trust prior to the time all benefit payments
        under the Arrangements have been made. All assets in the Trust at
        termination shall be returned to the Employer.

(d)     This Trust Agreement may not be amended or terminated by the Company for
        two (2) years following a Change in Control without the written consent
        of a majority of the Participants; provided however, the Trust Agreement
        may be amended by the Company and the Trustee following a Change in
        Control without the written consent of a majority of the Participants to
        comply with legal or regulatory requirements necessary to maintain the
        tax status for Participants or Beneficiaries.

(e)     In no event may this Trust Agreement be terminated as to any Accounts
        which have been established without the consent of the Participants or
        Beneficiaries for whom such Account was established..

                                       17
   18

SECTION 15.    CHANGE IN CONTROL

(a)     For purposes of this Trust, the following terms shall be defined as set
        forth below:

        (1)     Threatened Change in Control shall mean, as determined by the
                Company in its discretion:

                      Any pending offer for the Company's outstanding shares of
                      common stock, or any pending offer to acquire the Company
                      by merger or consolidation, or any other pending action or
                      plan to effect a Change in Control of the Company.

        (2)    Change in Control - The term "Change in Control" as used herein
               shall mean the occurrence of one of the following:

                             (i) the Company consolidates or merges with or into
                      another corporation, or is otherwise reorganized, if the
                      Company is not the surviving corporation in such
                      transaction or if after such transaction any other
                      corporation, association or other person, entity or group
                      or the shareholders thereof own, direct and/or indirectly,
                      more than 50% of the then outstanding shares of common
                      stock or more than 50% of the assets of the Company; or

                             (ii) more than 35% of the then outstanding shares
                      of common stock of the Company are, in a single
                      transaction or in a series of related transactions, sold
                      or otherwise transferred to or are acquired by any other
                      corporation, association or other person, entity or group,
                      whether or not any such shareholder or any shareholders
                      included in such group were shareholders of the Company
                      prior to the Change in Control; or

                             (iii) all or substantially all of the assets of the
                      Company are sold or otherwise transferred to or otherwise
                      acquired by any other corporation, association or other
                      person, entity or group; or

                             (iv) the occurrence of any other event or
                      circumstance which is not covered by (i) through (iii)
                      above which the Board determines affects control of the
                      Company and constitutes a Change in Control for purpose of
                      this Agreement.

(b)     The General Counsel of the Company shall have the specific authority to
        determine whether a Potential Change in Control or Change in Control has
        transpired under the guidance of this Section 15(a) and shall be
        required to give the Trustee notice of a Change in Control or a
        Potential Change in Control. The


                                       18
   19

        Trustee shall be entitled to rely upon such notice, but if the Trustee
        receives notice of a Change in Control from another source, the Trustee
        shall make its own independent determination.

SECTION 16.    FAILURE TO PAY

"Failure to Pay" shall mean that the circumstances described in either (a) or
(b) have occurred:

(a)     Any Plan Participant shall have notified the Trustee and the Company in
        writing that the Company shall have failed to pay to the Participant,
        when due, either directly or by direction to the Trustee in accordance
        with the terms hereof, at least 75% of any and all amounts which the
        Participant was entitled to receive at any time in accordance with the
        terms of any Plan, the Payment Schedule or this trust Agreement, and
        that such amount remains unpaid. Such notice must set forth the amount,
        if any, which was paid to the Participant, and the amount which the
        Participant believes he was entitled to receive under the Arrangements,
        the Payment Schedule and this Trust. Subject to this Trust, the failure
        to make such payment shall have continued for a period of 30 days after
        receipt of such notice by the Trustee and by the Company,and during such
        30 day period, the Company shall have failed to prove, by clear and
        convincing evidence as determined by the Trustee in its sole and
        absolute discretion, that such amount was in fact paid or was not due
        and payable; or

(b)     More than two Participants in an Arrangement shall have notified the
        Trustee and the Company in writing, either individually or jointly, that
        they have not been paid, when due, amounts to which they are entitled
        under the Arrangements, the Payment Schedule and this Trust. Within 15
        days after receipt of such notice, the Trustee shall determine on a
        preliminary basis, whether any failure to pay such Participants has
        resulted in a failure to pay when due, directly or by direction, at
        least 75% of the aggregate amount due to all Participants under the
        Arrangements, the Payment Schedule or this Trust and that such amount
        remains unpaid. Subject to this Trust, if the Trustee determines that
        such a failure has occurred, then it shall so notify the Company and
        Participants in writing. If the Company shall fail to prove by clear and
        convincing evidence as determined by the Trustee in its sole and
        absolute discretion that such payments have been made or were not due, a
        Failure to Pay shall be deemed to have occurred.

SECTION 17.    MISCELLANEOUS

(a)     Any provision of this Trust Agreement prohibited by law shall be
        ineffective to the extent of any such prohibition, without invalidating
        the remaining provisions hereof.

                                       19
   20

(b)     The Employer hereby represents and warrants that all of the Arrangements
        have been established, maintained and administered in accordance with
        all applicable laws, including without limitation, ERISA. The Employer
        hereby indemnifies and agrees to hold the Trustee harmless from all
        liabilities, including attorney's fees, relating to or arising out of
        the establishment, maintenance and administration of the Arrangements.
        To the extent the Employers do not pay any of such liabilities in a
        reasonably timely manner, the Trustee may obtain payment from the Trust.

(c)     Benefits payable to Participants and their Beneficiaries under this
        Trust Agreement may not be anticipated, assigned (either at law or in
        equity), alienated, pledged, encumbered or subjected to attachment,
        garnishment, levy, execution or other legal or equitable process.

(d)     This Trust Agreement shall be governed by and construed in accordance
        with the laws of North Carolina.

                                       20
   21

IN WITNESS WHEREOF, this Grantor Trust Agreement has been executed on behalf of
the parties hereto on the day and year first above written.


COMPANY                                 TRUSTEE

By:                                     By:
    /s/ E. A. ROSKOVENSKY                   /s/ Joe O. Long
- --------------------------------        ---------------------------------

Its:                                    Its:
     Compensation Committee                  SVP/GE
- --------------------------------        ---------------------------------

ATTEST:                                 ATTEST:


- --------------------------------        ---------------------------------

By:                                     By:

- --------------------------------        ---------------------------------

Its:                                    Its:

- --------------------------------        ---------------------------------

[ATTACH AN ADDITIONAL SIGNATURE PAGE FOR EACH SUBSIDIARY THAT IS A PARTY TO THE
TRUST AGREEMENT.]


                                       21
   22

                                    EXHIBIT A

                              QUADRAMED CORPORATION
                       NON-QUALIFIED DEFERRED COMPENSATION
                             PLANS AND ARRANGEMENTS



1.      QuadraMed Corporation Deferred Compensation Plan, effective January 1,
        2000.

2.      QuadraMed Corporation Stock Exchange Deferred Compensation Plan,
        effective January 3, 2000.

3.      QuadraMed Corporation Supplemental Executive Retirement Program,
        effective January 1, 2000.


                                       22