Document:

<PAGE>
                                                                   EXHIBIT 10.40

                            NOTE PREPAYMENT AGREEMENT

         THIS AGREEMENT ("AGREEMENT") is made as of October 15, 2003, between
Whitebox Hedged High Yield Partners ("WHITEBOX") and HEI, Inc. (the "COMPANY").

         WHEREAS, the Company issued to Colorado Medtech, Inc. ("CMED") the
Company's Subordinated Promissory Note dated January 24, 2003 payable to the
order of CMED in the original principal amount of $2,600,000 (the "Note");

         WHEREAS, on or about May 8, 2003, CMED sold the Note to Whitebox;

         WHEREAS, pursuant to a letter agreement dated on or about May 16, 2003
(as modified by subsequent agreements between Whitebox and the Company evidenced
by a letter agreement dated July 28, 2003 and an exchange of e-mail
communications dated September 12, 2003, the "LETTER AGREEMENT"), Whitebox
agreed to accept a discounted amount as payment in full of the outstanding
principal amount of the Note if such Note is prepaid in accordance with the
provisions of the Letter Agreement on or before October 15, 2003;

         WHEREAS, in connection with the latest modification of the Letter
Agreement, the Company paid Whitebox an advance payment of $50,000 (the "ADVANCE
PAYMENT"), such Advance Payment to be applied against the outstanding principal
amount of the Note in the event the Note is prepaid on or prior to October 15,
2003;

         WHEREAS, the Letter Agreement also provides that, in the event the Note
is prepaid on or prior to October 15, 2003, then (i) Whitebox will forgive
interest accrued on the outstanding principal amount of the Note from and after
September 15, 2003, and (ii) promptly following such prepayment, the Company
will issue, in payment of all interest accrued on the outstanding principal
amount of the Note through September 15, 2003, shares of the Company's common
stock; and

         WHEREAS, the Company now desires to so prepay the Note.

         NOW, THEREFORE, in consideration of the mutual covenants contained
herein and other good and valuable consideration, the parties to this Agreement
hereby agree as follows:

         1.       Prepayment of Note.

                  1.1 Prepayment. Contemporaneously with the signing of this
Agreement, to be applied against the outstanding principal amount of the Note
and as payment in full of the Note (i) Whitebox will apply the Advance Payment
against the Note, and (ii) the Company will pay Whitebox $2,190,000 (the "PAYOFF
AMOUNT") by wire transfer of immediately available funds into such account as
Whitebox shall designate.

<PAGE>

                  1.2 Payment in Full. Upon Whitebox's receipt of payment in
full of the Payoff Amount, the obligations of the Company under the Note or
otherwise incurred by the Company in connection with the Note (the
"OBLIGATIONS") shall be deemed to have been paid in full, and Whitebox shall be
deemed to have forgiven and waived the right to receive payment of any amount by
which the Obligations exceed the sum of the Advance Payment and the Payoff
Amount.

                  1.3 Delivery of Note. Promptly following receipt of payment in
full of the Payoff Amount (and in any event within 10 days from and after its
receipt of such payment), Whitebox shall cancel and deliver the original Note,
marked "paid in full," to the Company.

                  1.4 Issuance of Stock.

                  (a) Whitebox and the Company each acknowledge and agree that
the amount of interest accrued under the Note through September 15, 2003, equals
$166,940 (the "CONVERSION AMOUNT"). In payment of such Conversion Amount, the
Company agrees to issue to Whitebox 47,700 shares of the Company's common stock
(the "CONVERSION SHARES"), subject to and promptly following the execution and
delivery by Whitebox and the Company of a subscription agreement and such other
documentation as the Company may reasonably require (such agreement and other
documentation, in each case to be in form and substance reasonably satisfactory
to Whitebox and the Company, is herein referred to as the "SUBSCRIPTION
DOCUMENTATION"). The Subscription Documentation shall include, among other
provisions as to which Whitebox and the Company may agree, a piggyback
registration right (but not a demand registration right) with respect to the
Conversion Shares, such piggyback registration right to be effective for 24
months following the issuance of the Conversion Shares.

                  (b) Whitebox and the Company agree that they will negotiate in
good faith with a view to complete the Subscription Documentation and the
issuance of the Conversion Shares on or prior to December 1, 2003.

         2. Representations and Warranties of Whitebox. Whitebox represents and
warrants to the Company that (i) Whitebox is the owner of the Note, free and
clear of liens, encumbrances, purchase rights, claims, pledges, mortgages,
security interests or other limitations or restrictions whatsoever, other than
the provisions of the Letter Agreement, (ii) Whitebox is an entity duly
organized, validly existing and in good standing under the laws of the
jurisdiction in which it is formed, (iii) Whitebox has the requisite power and
authority to execute this Agreement and to consummate the transactions
contemplated by this Agreement, (iv) the execution and delivery of this
Agreement by Whitebox and the consummation by Whitebox of the transactions
contemplated by this Agreement have been duly authorized by all necessary action
on the part of Whitebox, and (v) this Agreement has been duly executed and
delivered by Whitebox and, assuming due execution and delivery by the Company,
constitutes a valid and binding obligation of Whitebox, enforceable against
Whitebox in accordance with its terms.

                                       2
<PAGE>

         3. Representations and Warranties of the Company. The Company
represents and warrants to Whitebox that (i) the Company is an entity duly
organized, validly existing and in good standing under the laws of the
jurisdiction in which it is formed, (ii) the Company has the requisite power and
authority to execute this Agreement and to consummate the transactions
contemplated by this Agreement, (iii) the execution and delivery of this
Agreement by the Company and the consummation by the Company of the transactions
contemplated by this Agreement have been duly authorized by all necessary action
on the part of the Company, and (iv) this Agreement has been duly executed and
delivered by the Company and, assuming due execution and delivery by Whitebox,
constitutes a valid and binding obligation of the Company, enforceable against
the Company in accordance with its terms.

         4.       Mutual Waiver and Release.

                  4.1 Release by Whitebox. Effective upon Whitebox's receipt of
payment in full of the Payoff Amount, Whitebox waives, releases and forever
discharges the Company and its past, present and future officers, partners,
managers, members, directors, employees, agents and affiliates from any and all
claims, obligations, demands, actions, causes of action and liabilities, of
whatsoever kind and nature, character and description, whether in law or equity,
whether sounding in tort, contract, or under other applicable law, whether known
or unknown, and whether anticipated or unanticipated, of or to Whitebox, which
Whitebox and its predecessors, successors or assigns ever had, now have, or may
have; provided, however, that Whitebox does not waive, release or discharge the
Company from any of the Company's obligations under this Agreement.

                  4.2 Release by the Company. Effective upon Whitebox's receipt
of payment in full of the Payoff Amount, the Company waives, releases and
forever discharges Whitebox and its past, present and future officers, partners,
managers, members, directors, employees, agents and affiliates from any and all
claims, obligations, demands, actions, causes of action and liabilities, of
whatsoever kind and nature, character and description, whether in law or equity,
whether sounding in tort, contract, or under other applicable law, whether known
or unknown, and whether anticipated or unanticipated, of or to the Company,
which the Company and its predecessors, successors or assigns ever had, now
have, or may have; provided, however, that the Company does not waive, release
or discharge Whitebox from any of Whitebox's obligations under this Agreement.

                  4.3 Consequences of Releases. The consequences of the
foregoing waiver provisions have been explained to each party by its counsel.
Each party acknowledges that it may hereafter discover facts different from, or
in addition to, those which they no know or believe to be true with respect to
its claims, and agree that this Agreement and the releases contained herein
shall be and remain effective in all respects, notwithstanding such different or
additional facts or the discovery thereof.

                                       3
<PAGE>

         5.       Further Assurances.  Each party agrees that each of them will
execute and deliver such further instruments and take such other action as may
reasonably be requested by either party hereto to carry out the purposes and
intents hereof.

         6.       Miscellaneous.

                  6.1 Survival of Representations, Warranties and Covenants. All
representations, warranties, covenants and agreements of the parties made herein
shall survive the execution and delivery of this Agreement and the consummation
of the transactions contemplated hereby.

                  6.2 Expenses. Each party shall bear its own expenses
(including, without limitation, attorney's fees) incurred in connection with the
negotiation and execution of this Agreement and the consummation of the
transactions contemplated hereby.

                  6.3 Entire Agreement; Amendments and Waivers. This Agreement
represents the entire understanding and agreement between the parties hereto
with respect to the subject matter hereof and can be amended, supplemented or
changed, and any provision hereof can be waived, only by a written instrument
making specific reference to this Agreement signed by the party against whom
enforcement of any such amendment, supplement, modification or waiver is sought.

                  6.4 Governing Law. This Agreement shall in all respects be
governed by and interpreted, construed, and determined in accordance with the
internal laws of the State of Minnesota (without regard to any conflict of laws
provision that would require the application of the law of any other
jurisdiction).

                  6.5 Headings. The section headings of this Agreement are for
reference purposes only and are to be given no effect in the construction and
interpretation of this Agreement.

                  6.6 Severability. If any provision of this Agreement is
invalid or unenforceable, the balance of this Agreement shall remain in effect.

                  6.7 Binding Effect; Assignment. This Agreement shall be
binding upon and inure to the benefit of the parties and their respective
successors and permitted assigns. No assignment of this Agreement or of any
rights or obligations hereunder may be made by any party (by operation of law or
otherwise) without the prior written consent of the other party hereto and any
attempted assignment without the required consent shall be void.

                  6.8 Counterparts; Facsimile Signatures. This Agreement may be
execute in any number of counterparts, each of which shall be deemed to be an
original, but all of which together will constitute one and the same instrument.
A telecopy of any such executed counterpart shall be deemed valid as an
original.

                                       4
<PAGE>

            [The remainder of this page is intentionally left blank]

                                       5

<PAGE>

         IN WITNESS WHEREOF, the parties hereto have caused this Agreement to be
executed by their respective officers thereunto duly authorized, as of the date
first written above.

HEI, INC.

By:  /s/ DOUGLAS J. NESBIT
   -----------------------------------------

Its: Chief Financial Officer
    ----------------------------------------

WHITEBOX HEDGED HIGH YIELD PARTNERS

By WHITEBOX ADVISORS, LLC,
         its general partner

By:  /s/ ANDREW J. REDLEAF
   -----------------------------------------

Its: Chief Executive Officer
    ----------------------------------------

..

                                       6<PAGE>
                                                                   EXHIBIT 10.41

                                PROMISSORY NOTE

$1,200,000.00                                                   October 14, 2003
                                                                Edina, Minnesota

     FOR VALUE RECEIVED, HEI, INC., a Minnesota corporation ("Maker") promises
to pay to the order of COMMERCE BANK, a Minnesota state banking corporation
("Payee") or its assigns, at its office located at 7650 Edinborough Way, Suite
150, Edina, Minnesota 55435, or such other place as may be designated from time
to time by the holder hereof, in lawful money of the United States of America,
the principal sum of ONE MILLION TWO HUNDRED THOUSAND AND NO/100 DOLLARS
($1,200,000.00), or the unpaid principal balance outstanding from all sums
advanced against this Note, whichever amount is less, together with interest
thereon as hereinafter provided.

     1.   Interest shall accrue on the principal balance hereof as follows:

          (a) Commencing on the date hereof, to and including October 31, 2006,
     interest shall accrue on the outstanding principal balance hereof at the
     rate of interest equal to 6.50% per annum; and

          (b) Commencing on November 1, 2006, to and including the Maturity Date
     (as hereinafter defined), interest shall accrue on the principal balance
     hereof at a fixed rate per annum, which rate shall be equal to the greater
     of (i) the Three-Year Treasury Base Rate (as hereinafter defined) plus
     three percent (3.0%), or (ii) the Prime Rate (as hereinafter defined) plus
     one percent (1.0%).

     As used herein, (a) "Three Year Treasury Base Rate" shall mean the average
yield rounded up to the nearest one-eighth percent (.125%) on the twenty
business days immediately preceding November 1, 2006 of the yield on United
States Treasury Notes adjusted to a constant maturity of three years as
published the Federal Reserve Board Release H.15 (or from such other
appropriate source determined by Payee if such Release is no longer published);
and (b) "Prime Rate" shall mean the rate published in the Wall Street Journal
as the base rate on corporate loans posted by at least 75% of the nation's
thirty largest banks.

     2.  Maker shall pay the principal of this Note and interest thereon as
follows:

          (a) On the first day of each month, commencing on November 1, 2003, to
     and including October 1, 2006, there shall be due and Maker shall pay
     monthly installments of principal and interest in the amount of Nine
     Thousand Eleven and No/100 Dollars ($9,011.00); and

          (b) On the first day of each month, commencing on November 1, 2006, to
     and including October 1, 2009, there shall be due and maker shall pay
     monthly installments of principal and interest, each of which shall be in
     an amount equal to the amount that would be required to amortize the
     remaining principal balance of this Note, over a term ending on November 1,
     2023, at the then applicable interest rate provided above.

<PAGE>

                                PROMISSORY NOTE
                                     Page 2

$1,200,000.00                                                   October 14, 2003
                                                                Edina, Minnesota

     On November 1, 2009 (the "Maturity Date"), the entire remaining principal
balance of this Note, together with any accrued, unpaid interest, shall be due
and payable in full.

     3.  Maker may prepay this Note in full at any time by giving Payee sixty
(60) days prior written notice. At any time of prepayment, and in consideration
of Payee's willingness to accept such prepayment, Maker shall pay, in addition
to the then outstanding principal balance plus accrued unpaid interest, a
prepayment premium as follows:

         (a) From the date hereof, to and including October 31, 2005, an amount
     equal to two percent (2%) of the outstanding principal balance of this Note
     as of the date of prepayment; and

         (b) From November 1, 2005, to and including, October 31, 2007, an
     amount equal to one percent (1%) of the outstanding principal balance of
     this Note as of the date of prepayment.

         (c) From and after November 1, 2007, this Note may be prepaid in full
     at any time without payment of a prepayment premium.

     4.  Interest charges will be calculated on amounts advanced hereunder on
the actual number of days said amounts are outstanding. Such interest shall be
computed on the basis of a year comprised of 360 days, but charged for the
actual number of days elapsed (including the first day but excluding the last
day) occurring in the period for which interest is payable. Payments under this
Note shall be applied initially against accrued interest and escrow charges, if
any, and thereafter in reduction of principal.

     5.  This Note is executed and delivered pursuant to, and is entitled to
the benefits of, that certain Term Loan Agreement, dated of even date herewith
(the "Loan Agreement"), between Maker, as borrower and Payee, as lender and
evidences the loan made or to be made pursuant to the terms and conditions of
the Loan Agreement.

     6.  This Note is secured, inter alia, by

         (a) that certain Combination Mortgage, Security Agreement, Assignment
     of Rents and Fixture Financing Statement of even date herewith between
     Maker as Mortgagor and Payee as Mortgagee, covering certain real property
     in the County of Carver, State of Minnesota, as described therein (the
     "Mortgage").

     7.  Maker acknowledges that if any payment required under this Note is not
paid within ten (10) days after the same becomes due and payable, Payee will
incur extra administrative expenses (i.e., in addition to expenses incident to
receipt of timely payment) in connection with the delinquency in payment.
Because, from the nature of the case, the actual damages suffered by Payee in
incurring such extra administrative expenses would be impracticable or
difficult to ascertain, it is agreed that three percent (3%) of the amount of
the
<PAGE>

                                PROMISSORY NOTE
                                     Page 3

$1,200,000.00                                                   October 14, 2003
                                                                Edina, Minnesota

delinquency payment shall be the amount of damages to which the Payee is
entitled, upon such breach, in compensation for such extra administrative
expenses. Therefore, the Maker shall, in such event, without further notice, pay
to Payee liquidated damages in the amount of three percent (3%) of the amount of
such delinquent payments. The provisions of this paragraph are intended to
govern only the determination of the above-described damages in the event of a
breach in performance of the obligation of Maker to make timely payments
hereunder. Nothing in this Note shall be construed as an express or implied
agreement by Payee to forbear in the collection of any delinquent payment, or be
construed as in any way giving the undersigned the right, express or implied, to
fail to make timely payment hereunder, whether upon payment of such damages or
otherwise. The right of Payee to receive payment of such liquidated damages, and
receipt thereof, are without prejudice to the right of Payee to collect such
delinquent payments and any other amounts required to be paid hereunder or under
any security for this Note or to declare a default hereunder or under any
security for this Note.

     8.  Maker hereby waives presentment and demand for payment, notice of
intent to accelerate maturity, protest or notice of protest and non-payment,
bringing of suit and diligence in taking any action to collect any sums owing
hereunder or in proceeding against any of the rights and properties securing
payment hereunder, and expressly agree that this Note, or any payment
hereunder, may be extended from time to time, and consent to the acceptance of
further security or the release of any security for this Note, all without in
any way affecting the liability of Maker. No extension of time for the payment
of this Note, or any installment thereof, made by agreement by Payee shall
affect the original liability under this Note of Maker.

     9.  It shall be an "Event of Default" under this Note if:

          (a) Maker fails to pay when due or, if payable on demand, upon demand,
     any principal of this Note, prepayment premium (if applicable), or interest
     on this Note, any other amount of money required to be paid pursuant to
     this Note, or any other obligation of Maker to Payee within ten (10) days
     after the same becomes due, whether at the stated maturity or at a date
     fixed for any installment payment or any accelerated payment date or
     otherwise; or

          (b) Maker fails to comply with or perform any other term, covenant,
     agreement or condition of this Note, the Mortgage, the Loan Agreement, or
     any other document or instrument securing the payment of this Note, and
     such failure or breach shall continue for a period of thirty (30) days
     after written notice thereof is delivered by the holder of this Note to
     Maker; or

          (c) Maker

               (i) becomes insolvent or fails to pay its debts generally as they
          become due,

               (ii) suspends business,

<PAGE>

                                PROMISSORY NOTE
                                     Page 4

$1,200,000.00                                                   October 14, 2003
                                                                Edina, Minnesota

               (iii) makes a general assignment for the benefit of creditors,

               (iv) admits in writing its inability to pay its debt generally as
          they mature,

               (v) files a petition in bankruptcy or a petition or answer
          seeking liquidation of it or a reorganization, arrangement with
          creditors or other similar relief under the Federal bankruptcy laws or
          under any other applicable law of the United States of America or any
          state thereof, whether now or hereafter in effect,

               (vi) petitions for or applies to any tribunal for, or consents to
          the appointment of a trustee, custodian, liquidator, receiver or
          similar official for it or for a substantial part of its property,
          (vii) is adjudicated a bankrupt or has an involuntary petition in
          bankruptcy, or a case commenced against it under the Federal
          bankruptcy laws, as now or hereafter in effect, and an order for
          relief entered therein,

               (viii) takes any action for the purpose of effecting or
          consenting to any of the foregoing, or

               (ix) has an order, judgment or decree entered appointing without
          such entity's consent, a trustee, custodian, liquidator, receiver or
          similar official for it or for a substantial part of its property, or
          approving a petition in any such proceeding or approving a petition
          filed or case commenced against it seeking liquidation of it or a
          reorganization, arrangement with creditors or other similar relief
          under the Federal bankruptcy laws or under any other applicable law of
          the United States of America or any State thereof, whether now or
          hereafter in effect, which order, judgment or decree shall not be
          vacated or set aside or stayed within 60 days from the date of entry;
          or

          (d) Maker is dissolved, liquidated or wound up; or

          (e) Any representation or warranty made by Maker in the Mortgage or
     made in connection with the execution and delivery of this Note and the
     Mortgage, or the making of the loan secured hereby, shall be incorrect or
     untrue in any material respect; or

          (g) An "Event of Default" as defined in the Mortgage or the Loan
     Agreement or any other Loan Document (as defined in the Loan Agreement)
     shall occur.

     10.  Upon the occurrence of an Event of Default (after expiration of any
applicable cure or grace periods), in addition to any other rights or remedies
Payee may have at law or in equity, Payee may, at its option, and without
notice to Maker, declare immediately due and payable the entire unpaid
principal sum hereof, together with all accrued and unpaid interest thereon at
a rate which is three percent (3%) per annum above the interest rate then
applicable hereunder on the date of such Event of Default (the "Default Rate"),
plus any other sums owing

<PAGE>

                                PROMISSORY NOTE
                                     Page 5

$1,200,000.00                                                   October 14, 2003
                                                                Edina, Minnesota

at the time of such Event of Default pursuant to this Note, the Mortgage, the
Loan Agreement or any other Loan Document.

     The failure to exercise the foregoing or any other options shall not
constitute a waiver of the right to exercise the same or any other option at
any subsequent time in respect of the same event or any other event. The
acceptance by the holder of any payment hereunder which is less than payment in
full of all amounts due and payable at the time of such payment shall not
constitute a waiver of the right to exercise any of the foregoing options at
that time or at any subsequent time.

     11.  This Note shall be binding upon and shall inure to the benefit of
the parties hereto and their respective successors and assigns, except that
Maker may not assign or transfer its rights hereunder without the prior written
consent of the Payee, which consent may be withheld in Payee's sole discretion.

     12.  This Note shall be governed by, interpreted and construed according to
the laws of the State of Minnesota. Maker hereby irrevocably submits to the
jurisdiction of the Minnesota District Court, Fourth District, and the Federal
District Court, District of Minnesota, Fourth Division, over any action or
proceeding arising out of or relating to this Note, and Maker hereby agrees that
all claims in respect of such action or proceeding may be heard and determined
in such Minnesota State or Federal court.

     13.  The invalidity or unenforceability in particular circumstances of any
provision of this Note shall not extend beyond such provision or such
circumstances and no other provision of this instrument shall be affected
thereby.

                                                HEI, INC.

                                                By:  /s/ Douglas J. Nesbit
                                                    ----------------------------
                                                    Its: Chief Financial Officer

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00059-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00059-of-00352.parquet"}]]