
21 Cal.3d 365 (1978)
578 P.2d 1375
146 Cal. Rptr. 371
JOHN A. McCONNELL et al., Plaintiffs and Appellants,
v.
MERRILL LYNCH, PIERCE, FENNER & SMITH, INC., Defendant and Appellant.
Docket No. L.A. 30795.
Supreme Court of California.
May 30, 1978.
*368 COUNSEL
Marcus Crahan, Jr., and Jack D. Scott for Plaintiffs and Appellants.
Macdonald, Halsted & Laybourne, Peter Brown Doland and Joel Mark for Defendant and Appellant.
OPINION
TOBRINER, J.
Plaintiffs filed a class action against defendant brokerage firm. They alleged, first, that defendant unlawfully charged compound interest on the debit balance in margin accounts without a clear written agreement authorizing the compounding of interest as required by section 2 of the Usury Law. Finding that defendant's customer's agreement complied with the requirements of section 2, the trial court sustained defendant's demurrer to this charge without leave to amend.
*369 Plaintiffs further alleged that defendant charged excessive interest. The complaint specifies that defendant charged a variable rate of interest based on the federal call money rate; that during a brief period in 1973 before defendant first secured an exemption from the 10 percent maximum permitted by article XX, section 22 of the California Constitution, increases in the call money rate led defendants to charge interest in excess of the 10 percent maximum.[1] The trial court, however, passing on the viability of plaintiffs' proposed class action, narrowly limited the class of persons who could attack such interest charges, and, finding that plaintiffs were not members of the class as restricted, refused to certify the suit as a class action. The court thereupon entered judgment for defendants, from which plaintiffs now appeal.
We explain our reasons for reversing the judgment below. (1a) First, in our opinion defendant's customer's agreement is not on its face and as a matter of law sufficiently clear to comply with section 2 of the Usury Law; the complaint thus states a cause of action charging unlawful collection of compound interest. (2a) Second, in the case of a variable interest rate the lawfulness of the interest under article XX, section 22, does not depend upon the average interest charge over the full term of the loan, as the trial court ruled, but upon whether the parties entered into the variable-rate agreement in good faith and without intent to avoid the usury laws. On its face the complaint therefore states a cause of action, but the issues of good faith and possible intent to violate the usury laws must be resolved at trial. (3a) Since the trial court relied upon an inapplicable principle of law to exclude plaintiffs from the class of *370 persons who could complain of defendant's interest charges, its ruling refusing to certify plaintiffs' suit as a class action must also be reversed.

1. Proceedings in superior court.

Plaintiffs John and Marguerite McConnell allege that they established a margin account with defendant in 1966. The customer's agreement signed by plaintiffs provided in part that "The monthly debit balance in my account(s) shall be charged, in accordance with your usual custom with interest at a rate which shall include the average rate paid by you on your general loans during the period covered by such balances respectively, and any extra rate caused by market stringency, together with a charge to cover your credit service and facilities." Defendant computes interest on a 360-day year. It adds interest owing at the end of each month to the debit balance of the customer's account which balance bears interest in the following month, thus compounding interest monthly. The rate of interest charged by defendant is set to equal the rate defendant pays commercial lenders for brokerage loans (the "call money rate") plus a service charge ranging from 1/2 percent per annum for debit balances over $35,000 to 1 1/2 percent per annum for balances under $10,000.
During the summer of 1973 the call money rate increased steadily, reaching 8 1/4 percent on July 5 and 10 percent on September 4. Plaintiffs' margin account during this period showed a debit balance of less than $10,000 and thus became subject to a service charge of 1 1/2 percent. Consequently, the rate of interest charged plaintiffs during the period from July 5, 1973, to September 26, 1973, exceeded 10 percent per annum. During this period defendant was subject to the 10 percent limit on lawful interest of article XX, section 22; on September 26, however, defendant secured a license as a personal property broker which exempted it from the 10 percent interest ceiling.
Plaintiffs filed suit individually and on behalf of a class of all California customers who maintained margin accounts with defendant from November 26, 1971, to September 26, 1973, and who were charged unlawful interest. Plaintiffs' second amended complaint asserts five causes of action. The first and second causes of action alleged that defendant charged compound interest in violation of section 2 of the Usury Law, which prohibits charging interest on interest "unless an agreement to that effect is clearly expressed in writing...."[2] The third *371 and fourth causes of action alleged that defendant charged interest in excess of 10 percent in violation of article XX, section 22 of the California Constitution. The fifth cause of action sought declaratory relief with respect to the alleged payment of compound and usurious interest. Finally, plaintiffs prayed for recovery of interest charged during the period in question, and for treble damages.
When defendant demurred to the second amended complaint, plaintiffs asked the trial court to rule upon their motion, filed earlier, for certification of their suit as a class action. The court accordingly ruled in a single order upon both that motion and defendant's demurrer. As to the allegations of unlawful compounding of interest, the trial court held that the customer's agreement on its face complied with the requirements of section 2 of the Usury Law. The court therefore sustained defendant's demurrer without leave to amend to the first and second causes of action and that portion of the fifth cause of action respecting compounding of interest.
The court entered a complex order on the causes of action asserting that defendant charged excessive interest. First, the court determined that the usurious character of the interest charged must be determined by averaging the interest over a period running from the opening of each margin account to September 26, 1973. It therefore concluded that the only persons charged usurious interest were those members of a class, which it referred to as the "court's class," who opened accounts shortly before September 26, 1973, at a time when interest rates were high, such that the average rate of interest charged from the opening of the account to September 26 exceeded a 10 percent annual rate. The court then ruled that as to the "court's class" (a) common questions of law and fact predominated except for the question of treble damages, (b) the class action procedure surpassed other available methods for adjudication of the controversy, but that (c) plaintiffs were not members of the class and *372 (d) could not properly represent it.[3] As to treble damages, the court declared that this issue did not fall within the scope of the class action because the court in its discretion would assess such damages based upon facts peculiar and unique to each customer.
The court refused to certify plaintiffs' proposed class on the ground that, if interest were averaged from the opening of the account to September 26, 1973, only those persons in the smaller "court's class" actually paid interest in excess of 10 percent per annum. The court declared hypothetically, however, that if plaintiffs' class were recognized, it would necessarily split into two subclasses: those who signed customer's agreements that provided that New York law would govern their interpretation and that contained arbitration clauses, and those, such as plaintiffs, who signed agreements lacking those provisions. As to the latter subclass, the court found (a) that common questions of law and fact predominated except for the question of treble damages, (b) that a class action presented the superior mode of adjudicating the controversy, (c) that plaintiffs were members of the subclass, and (d) that plaintiffs could fairly represent the subclass.
Concluding that although a cause of action for usury could be stated on behalf of the "court's class," plaintiffs were not members of and could not represent that class, the court entered its order dismissing plaintiffs' suit as both a class and individual action. Plaintiffs appealed from the judgment of dismissal; defendant cross-appealed from portions of the class action ruling.[4]

(1b) 2. Section 2 of the Usury Law prohibits the compounding of interest "unless an agreement to that effect is clearly expressed in writing and signed by the party to be charged"; the customer's agreement does not on its face comply with that requirement.

*373 Section 2 of the Usury Law states in part that "... in the computation of interest upon any bond, note, or other instrument or agreement, interest shall not be compounded, nor shall the interest thereon be construed to bear interest unless an agreement to that effect is clearly expressed in writing and signed by the party to be charged therewith...." Plaintiffs assert that the customer's agreement does not clearly provide for the compounding of interest, and hence that defendant violated the Usury Law in charging compound interest.
As we noted earlier, the customer's agreement signed by plaintiffs provided that "The monthly debit balance in my account(s) shall be charged, in accordance with your usual custom with interest...." Defendant first argues that the phrase "monthly debit balance" clearly denotes that interest will be compounded because each monthly debit balance includes interest charges assessed in prior months.
To establish that interest was not illegally compounded defendant relies on the cases of Lewis v. Pacific States Sav. & Loan Co. (1934) 1 Cal.2d 691 [37 P.2d 439], and Ricord v. Aragon (1952) 115 Cal. App.2d 176, 178 [251 P.2d 759], which held that the involved lending agreements there did not violate the usury laws; both decisions, however, are distinguishable. Although the agreements in Lewis and Ricord identify as "principal" certain bonuses and service charges, which the courts found to be a form of interest, in each of the cases the agreement clearly stated on its face that the charges, however labeled, were subject to interest, and thus clearly authorized charging interest upon interest.
The courts have also upheld lending agreements in Heald v. Friis-Hansen (1959) 52 Cal.2d 834 [345 P.2d 457] and Penzner v. Foster (1959) 170 Cal. App.2d 106, 108-109 [338 P.2d 533], but the agreements in those cases provided specifically that interest not paid would become part of principal and thereafter bear interest. Defendant's customer's agreement, in contrast, neither identifies unpaid interest as a form of principal nor expressly states that unpaid interest is itself subject to an interest charge. The term "monthly debit balance" could reasonably be construed to refer only to the principal balance. That term does not constitute a clear expression authorizing the compounding of interest.
Defendant also argues that its "usual custom," to which it referred in the customer's agreement, includes its practice of charging compound *374 interest.[5] The face of the agreement, however, does not specify that defendant's custom embraced the charging of compound interest. (4) (See fn. 6.) Cognizant of this weakness in its position, defendant at the hearing on the demurrer asked the trial court to take judicial notice of a booklet entitled "What is Margin?" and of defendant's monthly statements to plaintiff as proof of its custom of charging compound interest.[6] (1c) In response to this request, according to defendant, a colloquy ensued in which the parties agreed that the court could consider the demurrer as a motion for partial summary judgment.[7]
Viewed as a motion for partial summary judgment, however, the defendant's presentation is plainly deficient, for no declarations show that the booklet and statements in fact represented defendant's "custom" in 1973. Neither do any declarations show that plaintiffs and other members *375 of the class received the booklet or were aware of the "custom" or that the parties intended by the contractual reference to "custom" to authorize the compounding of interest.
Moreover, the preamble to the court's order, prepared by counsel for defendant, expressly states that "all counsel agreed that ... the Court could ... make a determination as to whether or not the subject `Customer's Agreement' ... standing alone and not in conjunction with any other evidence that may have been previously admitted, complied with the requirements of [section 2 of the Usury Law]." (Italics added.) The court's ruling followed identical language, thus demonstrating that the court did not consider the booklet or statements in ruling on the demurrer.
In summary, the customer's agreement on its face does not clearly express an understanding that interest would be compounded. The trial court therefore erred in sustaining defendant's demurrer on the basis that the agreement on its face complied with section 2 of the Usury Law. That ruling cannot be sustained on the theory that the demurrer was a motion for partial summary judgment; the trial court clearly based its ruling on the face of the agreement, and the record on appeal does not establish as a matter of law that the agreement's reference to defendant's "usual custom" demonstrates that the parties "clearly expressed in writing" that defendant could charge compound interest.

(2b) 3. Since the parties agreed to a variable-interest rate which could exceed the constitutional limits under certain contingencies, the lawfulness of the agreement depends on whether the parties contracted in good faith and without intent to avoid the usury laws.

As we noted earlier, plaintiffs and defendant entered into an agreement which provided for a variable interest rate. Because of an increase in the call money rate, defendant, pursuant to that agreement, charged interest in excess of 10 percent from July 5, 1973, until September 26, 1973. The issue before us is whether such charges violated the usury laws, specifically section 2 of the initiative act as modified by the 10 percent limitation on interest of article XX, section 22, of the California Constitution.
While the instant case was pending on appeal, the Court of Appeal published its opinion in Arneill Ranch v. Petit (1976) 64 Cal. App.3d 277 [134 Cal. Rptr. 456]. The opinion of Justice Potter in Arneill Ranch elucidated the principle that a variable-interest rate agreement, although *376 it provides under certain conditions for interest charges in excess of 10 percent, does not violate the prohibition of excessive interest if the parties contracted in good faith and without intent to avoid the usury laws. Our discussion of the issue of excessive interest in the present case follows the analysis of Justice Potter in Arneill Ranch.
In Arneill Ranch, the debtor signed a note providing for interest "`at the rate of 7 1/2 percent per annum, or at the prime rate plus 2 percent ..., whichever is greater.'" (64 Cal. App.3d at p. 280.) Because of increases in the prime rate, interest charged the debtor in Arneill Ranch for the period April 1, 1973, to October 1, 1973, equalled 10.008 percent, and during the period October 1, 1973, to April 1, 1974, equalled 11.46 percent. Maintaining that the note was usurious, the debtor sued for treble damages.
The first question to be resolved in both Arneill Ranch and the present case was the length of the period over which interest would be computed to determine whether the rate of interest was usurious. As in the instant case, the trial court in Arneill Ranch held that the usurious character of the interest charge must be determined over the full period of the loan. Since the total interest charge in Arneill Ranch, spread over the entire period of the loan, did not exceed 10 percent, the trial court concluded that the note was not usurious even though the interest charges for some interim periods exceeded 10 percent.
The Court of Appeal in Arneill Ranch, reversing the trial court, pointed out that all cases which sanction averaging of interest over the original full period of the loan "involved situations in which the total compensation to the creditor included some charges on account of the total loan period which, when spread throughout such period, did not produce a total return in excess of the maximum rate but, by reason of the debtor's voluntary shortening of the term, did produce such excess." (64 Cal. App.3d 277, 290; citing French v. Mortgage Guarantee Co. (1940) 16 Cal.2d 26, 29-32 [104 P.2d 655, 130 A.L.R. 67] and cases there listed.) Under such circumstances, averaging interest over the original entire term serves the purpose of preventing the debtor, by default or premature payment, from unfairly transforming an innocent transaction into a usurious one.
The present case is quite different from those decisions which established the general rule that interest should be averaged over the full *377 term of the loan; indeed, in the present context such a rule would prove unworkable. Plaintiffs' margin account contemplates a credit arrangement of variable interest, of indefinite duration, and fluctuating balance. If interest were to be averaged over the full term of the loan, there would be no way to determine whether an existing credit arrangement were lawful or not; that issue could not be resolved until the account were closed, and either debtor or creditor by choosing the right moment to close the account could cause the interest over the term to exceed lawful rates.
(5) As Arneill Ranch explained (see 64 Cal. App.3d at p. 293), when an agreement provides for a variable-interest rate, no agreed total profit to the lender can be averaged over the entire period of the loan. Under such circumstances, the interest payable for each portion of the loan term is the compensation to the lender for his forbearance from requiring immediate payment of the principal sum during that specific portion of the term. Thus the fact that the average interest charge on a variable-rate loan does not exceed the maximum rate is not in itself sufficient to establish that the loan complies with the usury laws if the interest charged for a particular period of forbearance exceeds the legal limit.
(2c) That conclusion brings us to the question whether an agreement which provides for variable interest which under some contingencies may exceed the constitutional limit is usurious. Although two prior cases (Calimpco, Inc. v. Warden (1950) 100 Cal. App.2d 429, 450 [224 P.2d 421]; Penziner v. West American Finance Co. (1933) 133 Cal. App. 578, 590 [24 P.2d 501]) state that an agreement is usurious if a contingency not in the borrower's control causes the excess interest, both cases involved agreements allegedly designed to evade the usury laws. (See Arneill Ranch v. Petit, supra, 64 Cal. App.3d 277, 284-285.) On the other hand the majority of decisions uphold the legality of a variable interest agreement if the transaction was consummated in good faith without intent to avoid the usury laws. (Arneill Ranch v. Petit, supra, 64 Cal. App.3d 277, 289; Thomassen v. Carr (1967) 250 Cal. App.2d 341, 346-348 [58 Cal. Rptr. 297]; Wooten v. Coerber (1963) 213 Cal. App.2d 142 [28 Cal. Rptr. 635]; Schiff v. Pruitt (1956) 144 Cal. App.2d 493, 499 [301 P.2d 446]; Miley P. Corp., Ltd. v. Amerada P. Corp. (1936) 18 Cal. App.2d 182, 189 [63 P.2d 1210]; Lamb v. Herndon (1929) 97 Cal. App. 193, 201 [275 P. 503]; Jameson v. Warren (1928) 91 Cal. App. 590, 595 [267 P. 372]; see Rest., Contracts, § 527.)
The recognition of the right of the parties to contract in good faith for a variable-interest rate, even though such a rate may at times exceed the *378 constitutional maximum, not only finds support in the weight of authority but also in practical good sense. In the present case, for example, defendant asserts that it borrows the money that it lends plaintiffs at a rate of interest, the call-money rate, set by factors not within the parties' control. Thus the parties may reasonably agree that defendant's loans to plaintiffs will bear interest at a rate which varies in unison with the call-money rate. Although at times when the call money rate is high plaintiffs may be paying more than 10 percent interest, when at times the rate is lower plaintiffs may be charged less than the maximum legal rate. A strict construction of the usury laws without consideration for the characteristics of variable-rate loans would force defendant, whenever confronted with high call-money rates, to choose between calling in its margin loans or advancing money for less than cost, even though defendant entered into the margin agreements in good faith and without intent to avoid the usury laws.
Therefore, assuming that defendant did in fact charge interest at a rate in excess of 10 percent during the summer of 1973, the lawfulness of that charge turns on "whether the parties acted in good faith and without intent to avoid the usury laws," or merely cast the transaction as an agreement for a variable rate of interest "as a colorable device to obtain a greater profit than was permissible under [the usury] laws." (Arneill Ranch v. Petit, supra, 64 Cal. App.3d 277, 289.) Although the documents before us on appeal appear consistent with good faith, plaintiffs, as the issues were framed below, were not called upon to contest defendant's good faith and the court did not place its decision on the ground of good faith. (See Arneill Ranch v. Petit, supra, 64 Cal. App.3d 277, 294.) The issue of good faith thus remains a matter which must be resolved by the trial court.

(3b) 4. The trial court's ruling upon plaintiffs' motion for certification of the suit as a class action should be remanded for further consideration.

The trial court's complex order on plaintiffs' motion for certification of their action inextricably relates to the court's misapprehension of the controlling legal principles. The crucial determination that plaintiffs were not members of a class who could state a cause of action for excessive interest rests directly upon the trial court's view that interest must be averaged from the opening of the margin account to September 26, 1973. With the exception of the court's ruling on the issue of treble damages, the court's order including the portion of the order challenged by the *379 cross-appeal rests also on this mistaken premise and, in view of the above discussion, should be remanded to the trial court for reconsideration.
The trial court's ruling that plaintiffs could not assert a class action to recover treble damages, however, rests on an independent ground. (6a) Apparently the trial court concluded that because the "granting of treble damages upon a finding of usury is a matter within the trial court's discretion" (Burr v. Capital Reserve Corp. (1969) 71 Cal.2d 983, 994 [80 Cal. Rptr. 345, 458 P.2d 185]), all cases involving such damages should be presented by individuals rather than by a class.[8] In awarding treble damages, however, the court does not exercise an abstract discretion, but must base its ruling on the facts of the transaction at issue. (Cf. Riskin v. Towers (1944) 24 Cal.2d 274, 279 [148 P.2d 611, 153 A.L.R. 442]; Troendle v. Clinch (1946) 74 Cal. App.2d 480, 484 [169 P.2d 55]; 6 Witkin, Cal. Procedure (2d ed. 1971) pp. 4235-4236.) (7), (See fn. 9.) (6b) If the common facts of a class of transactions so predominate over the individual differences distinguishing those transactions that a class action excels other available methods of adjudicating the issues raised by the treble damage claim, we find no rule which prevents the court from certifying a class action. (Cf. Partain v. First National Bank of Montgomery (M.D.Ala. 1973) 59 F.R.D. 56.)[9]
We therefore conclude that the trial court should vacate its order refusing to certify this case as a class action and reconsider that matter anew. Upon such reconsideration, the plaintiffs' class with respect to their claim for recovery of damages for excessive interest should be defined to limit its membership to those California customers who maintained margin accounts with defendant during the period July 5, 1973, to September 26, 1973, and who, within one year preceding the filing of plaintiffs' complaint, paid interest charged by defendant during that period pursuant to any agreement with defendant other than a variable-rate *380 agreement entered into in good faith and without intent to avoid the usury laws.[10] In the light of that redefinition of plaintiffs' class, of the principles of law set out in this opinion, and of such additional evidence as the parties may offer,[11] the trial court may then decide whether to certify this suit as a class action on behalf of the palintiffs' class or as appropriate subclass.[12]
We briefly summarize our conclusions. First, defendant's customer's agreement does not on its face clearly express the agreement of the parties to authorize defendant to charge compound interest; plaintiffs' complaint therefore states a cause of action alleging that defendant unlawfully charged compound interest. Second, the trial court's order refusing to certify plaintiffs' class action alleging excessive interest was based on that court's conclusion that interest charged must be averaged from the opening of the account until September 26, 1973. We reject that conclusion and hold that, assuming as alleged that the interest charged from July 5 to September 26, 1973 exceeded 10 percent, the validity of the agreement turns on whether the parties contracted in good faith and without intent to avoid the usury laws. The trial court should therefore reconsider the certification of plaintiffs' class action in light of this holding.
In sum, the People by initiative and constitutional amendment have prohibited the compounding of interest unless the party to be charged signs an agreement which clearly so expresses in writing, and have limited the rate of interest to 10 percent; interpreting the latter prohibition, the courts hold that an agreement may provide for a variable interest rate that may at times exceed the legal rate if the parties so contract in good faith and without an intent to avoid the usury laws. *381 Compliance with these clear requisites does not impose an onerous burden. The instant complaint draws the outlines of causes of action on both of the above postulates, but plaintiffs' recovery must entirely depend upon the coloration and full picturization of the sketch by a factual showing at trial.
The judgment is reversed and the cause remanded for further proceedings consistent with the views expressed herein.
Bird, C.J., Mosk, J., Richardson, J., Manuel, J., and Newman, J., concurred.
CLARK, J.
I dissent. The second amended complaint states a cause of action neither for unlawful compounding of interest nor for usury. It is evident the complaint cannot be amended to state a cause of action. The judgment of dismissal should be affirmed.

COMPOUND INTEREST
The trial court properly sustained demurrer to the compound interest causes of action of the second amended complaint.
Section 2 of the Usury Law provides that interest shall not be compounded unless an agreement to that effect is clearly expressed in writing. The second amended complaint alleges that plaintiffs and the members of the class executed an agreement providing: "The monthly debit balance in my account(s) shall be charged, in accordance with your usual custom with interest at a rate which shall include...."
In Lewis v. Pacific States Sav. & Loan Co. (1934) 1 Cal.2d 691, 694-695 [37 P.2d 439], and Ricord v. Aragon (1952) 115 Cal. App.2d 176, 178-179 [251 P.2d 759], the principal stated in the loan included certain charges which were in fact interest, and the note provided for interest on the principal. In responses to claims that interest was being charged on interest without a statement to that effect in the note, the courts held that the note itself showed that interest was to be computed upon the principal amounts which included the interest charges.
Those cases make clear that the agreement need not use magic words, but is sufficient if the plain meaning of the terms used import interest is to be charged on interest.
*382 The phrase the "monthly debit balance in my account(s) shall be charged ... with interest" literally means that interest will be added to the balance. When one charges an account, he adds to the account, and when one charges a debit balance, he adds to the debit balance. The only reasonable construction is that the debit balance will include interest charges, and since it is equally obvious that the interest is to be computed on the debit balance, the only reasonable construction of the phrase is that it provides for interest to be charged on the debit balance which will include prior interest charges.[1]
Moreover, the agreement expressly provided that the interest charge to the debit balance would be "in accordance with your usual custom." The second amended complaint alleges that "at all times mentioned herein" (1966-1973) defendant charged compound interest to its California margin account customers. The majority inventively argue that defendant's booklet "What is Margin?" was not properly before the court when it sustained the demurrers to the compound interest causes of action. The booklet, of course, is urged as establishing defendant's custom. But the custom is established by the allegations of the second amended complaint. No citation of authority is necessary for the elementary proposition that, in ruling on demurrer to a complaint, the allegations of the complaint are before the trial court.
The defects in plaintiffs' causes of action for unlawful compounding cannot be cured by amendment since they result from the agreements sued upon and the custom attacked.

USURY

A. Actus Reus

The trial court properly concluded that a variable interest rate loan agreement is not unlawful when the amount of interest charged pursuant to the agreement does not exceed the amount which might have been charged had the agreement provided for a flat rate of 10 percent per annum, the maximum permissible rate under article XV, section 1 of the California Constitution.
*383 The usury laws are obviously penal in nature, providing for forfeitures and treble damages. (49 Cal.Jur.2d, pp. 675-676, 682-684.) Because of the laws' penal nature, both an actus reus and a mens rea should be essential to establish a violation of the law. Mere bad intentions without excessive interest charges should not permit a borrower to recover a forfeiture or treble damages.
Variable interest rate agreements may inure to the benefit of either the borrower or lender. They provide a valuable means for both borrowers and lenders to adjust interest rates to the changing conditions of the economy to suit their needs. (Ante, pp. 377-378.) There is nothing immoral or illegal about such agreements when application of the variable rate provisions can and does result in interest charges less than the interest charges which would have resulted by application of the maximum lawful rate to the amounts borrowed. It is manifestly unjust to hold, as the majority would permit, that a lender must forfeit interest or pay treble damages when he, in fact, charged less than he could have lawfully charged.
The majority states that a rule "that interest should be averaged over the full term of the loan ... in the present context ... would prove unworkable." (Ante, pp. 376-377.) The majority points out that plaintiffs' margin account contemplates a credit arrangement of variable interest, of indefinite duration, and fluctuating balance. However, this furnishes no basis for refusing to uphold the trial court's approach of looking to the realities. The test is not averaging interest rates; it is determining whether the maximum lawful interest charge was exceeded by the interest charge made under the variable agreement. This is a simple matter. Computing maximum lawful interest charges when the balance due is fluctuating is hardly complex. The interest charge is computed for each change. The other part of the comparison  the interest actually charged  must be determined in any event to establish damages.
I am satisfied that before a variable interest rate  which could produce a lawful interest charge  may be declared unlawful, not only must mens rea be shown but also actus reus. That is, the interest charged pursuant to the agreement must exceed the amount of interest that could have been lawfully charged under a fixed rate agreement.
Apart from Arneill Ranch v. Petit (1976) 64 Cal. App.3d 277 [134 Cal. Rptr. 456], I am aware of no case  and the majority has cited none  holding that a lender could be labelled a usurer, when the interest *384 charged in accordance with a variable contract provision was less than the maximum interest permitted to be charged under the usury laws. Rather the cases involve situations where the interest charged pursuant to the agreement was excess interest. (See, e.g., Thomassen v. Carr (1967) 250 Cal. App.2d 341, 346-348 [58 Cal. Rptr. 297].) In such cases the proper rule  as pointed out by the majority  determines whether a variable interest agreement is usurious by asking if the agreement "was consummated in good faith without intent to avoid the usury laws." (Ante, p. 377.) But this does not mean that we will inquire into good faith when the interest charged was below that permissible. To allow a borrower to avoid his obligation to pay interest when the interest charged pursuant to the variable rate is less than the lawful rate is to give a person who suffered no wrong a windfall. I would disapprove Arneill Ranch insofar as it permits such windfall.

B. Mens Rea

The majority's own rule requires a conclusion that the complaint does not state a cause of action for usury.
The majority's rule is: "3. Since the parties agreed to a variable-interest rate which could exceed the constitutional limits under certain contingencies, the lawfulness of the agreement depends on whether the parties contracted in good faith and without intent to avoid the usury laws." (Italics in orig.; ante, p. 375.)
The crucial issue being whether the parties contracted in good faith and without intent to avoid the usury laws, plaintiff to state a cause of action must allege that the parties contracted in bad faith with intent to avoid the usury laws. The burden of alleging bad faith must lie with the party claiming usury. Certainly a cause of action cannot be stated merely by alleging that the agreement provided for a variable rate. (Under the majority rules, the amount of interest charged is irrelevant.) In light of the majority's recognition that variable interest rates find support "in practical good sense" (ante, p. 378), it would be anomalous, at best, to hold that a cause of action for usury is stated by merely alleging a variable rate transaction.
The second amended complaint contains no allegation  in either the individual or class causes of action  that defendant contracted in bad faith with intent to avoid the usury laws.
*385 Furthermore, it is apparent that plaintiffs are in no position to allege that the contract or contracts were entered into in bad faith with intent to avoid the usury laws. According to the complaint, plaintiffs entered into their contract providing for the variable interest rate in 1966, and it was not until 1973 that the variable rate charged exceeded 10 percent. Nowhere has it been intimated that during the lower interest rates of the 1960's defendant had a devious plan to avoid the usury laws and therefore adopted the variable rate system. The class is in no better position than the named plaintiffs because the allegations of the complaint make clear that defendant's contracts were not changed over the years but remained constant as to the interest charge.
In the absence of any allegation that the contracts were entered into in bad faith with intent to avoid usury laws, and in absence of any claim by plaintiffs that the second amended complaint could be amended to allege bad faith, I conclude, contrary to the majority (ante, p. 369), that the counts charging excessive interest fail to state a cause of action.
I would affirm the judgment.
The petition of the plaintiffs and appellants for a rehearing was denied June 29, 1978, and the opinion was modified to read as printed above.
NOTES
[1]  Section 2 of the Usury Law [Deering's Ann. Uncod. Measures 1919-1, § 2 (1973 ed.) p. 40; 10 West's Ann. Civ. Code (1954 ed.) foll. § 1916, p. 137 (1978 Cum. Supp.) p. 31] specified a maximum rate of interest of 12 percent. That section was superseded in part by the enactment in 1934 of article XX, section 22 of the California Constitution, which specified a maximum rate of 10 percent. Article XX, section 22 was renumbered in 1976 as article XV, section 1.

At all times relevant to the present case article XX, section 22 provided that:
"The rate of interest upon the loan or forbearance of any money, goods or things in action, or on accounts after demand or judgment rendered in any court of the State, shall be 7 percent per annum but it shall be competent for the parties to any loan or forbearance of any money, goods or things in action to contract in writing for a rate of interest not exceeding 10 percent per annum.
"No person, association, copartnership or corporation shall by charging any fee, bonus, commission, discount or other compensation receive from a borrower more than 10 percent per annum upon any loan or forbearance of any money, goods or things in action."
Section 22 went on to provide that "However, none of the above restrictions shall apply" to corporations licensed under various laws, including corporations licensed as personal property brokers. Defendant first obtained such a license on September 26, 1973.
[2]  Section 2 of the Usury Law reads as follows: "No person, company, association or corporation shall directly or indirectly take or receive in money, goods or things in action, or in any other manner whatsoever, any greater sum or any greater value for the loan or forbearance of money, goods or things in action than at the rate of twelve dollars upon one hundred dollars for one year; and in the computation of interest upon any bond, note, or other instrument or agreement, interest shall not be compounded, nor shall the interest thereon be construed to bear interest unless an agreement to that effect is clearly expressed in writing and signed by the party to be charged therewith. Any agreement or contract of any nature in conflict with the provisions of this section shall be null and void as to any agreement or stipulation therein contained to pay interest and no action at law to recover interest in any sum shall be maintained and the debt can not be declared due until the full period of time it was contracted for has elapsed." As noted in footnote 1, ante, the 12 percent maximum specified in this section was superseded by the provisions of California Constitution article XX, section 22.
[3]  Having opened their account in 1966, plaintiffs enjoyed six years during which interest charges were less than 10 percent. Thus although plaintiffs were charged interest in excess of 10 percent during the summer of 1973, the average interest paid by plaintiffs, computed from the opening of their account to September 26, 1973, was less than 10 percent.
[4]  The cross-appeal attacks the trial court's ruling that as to the "court's class" common questions predominate and a class action is a superior means of adjudicating the controversy. It further attacks all portions of the court's hypothetical ruling concerning the subclass of plaintiffs who signed agreements lacking choice of law and arbitration clauses.
[5]  In responding to defendant's contention that defendant's usual custom included charging compound interest, plaintiffs rely heavily on Robertson v. Dodson (1942) 54 Cal. App.2d 661 [129 P.2d 726]. In that case the plaintiff agreed to purchase real property from the defendant after securing a deed of trust from a third party lender. Plaintiff subsequently refused to sign the note offered by the lender because it called for compound interest. Defendant claimed that plaintiff had breached the land sale contract by unreasonably refusing to sign the note, since plaintiff knew that the lender's usual custom was to charge compound interest.

In rejecting defendant's argument, the Court of Appeal stated that in view of the requirement in section 2 of the Usury Law that an agreement for compound interest be clearly expressed in writing, the court could not imply an agreement to consent to such interest. "Custom and usage," the court held, "may be used as an instrument of interpretation, but may not be used to create a contract." (54 Cal. App.2d 661, 665.)
In the present case, however, the contract itself referred to defendant's "usual custom." Evidence of custom in the present case thus would not serve to create a new contract, but to interpret the parties' written agreement. Plaintiffs do not contend that section 2 of the Usury Law bars admission of extrinsic evidence at trial to show that contractual language clearly expressed the parties' intention to permit compounding of interest.
[6]  Ordinarily a demurrer cannot be based upon evidence or other matter extrinsic to the complaint. (See, e.g., Cravens v. Coghlan (1957) 154 Cal. App.2d 215, 217 [315 P.2d 910].) Defendant argued, however, that since the booklet had been offered into evidence by plaintiffs, the court could take judicial notice of it in ruling on the demurrer. (See Able v. Van Der Zee (1967) 256 Cal. App.2d 728, 734 [64 Cal. Rptr. 481]; Dwan v. Dixon (1963) 216 Cal. App.2d 260, 265 [30 Cal. Rptr. 749].)
[7]  This colloquy is not part of the record on appeal. The colloquy is quoted at length in plaintiffs' petition for rehearing in the Court of Appeal and in defendant's answer to plaintiffs' petition for hearing. The quoted discussion indicates that plaintiffs agreed that the customer's agreement was properly before the court on the demurrer. The discussion does not indicate that plaintiffs or the court agreed that the booklet "What is Margin?" or defendant's monthly statements were properly before the court either by demurrer or motion for summary judgment.

The court's minute order states that "The Court considers the demurrer as a motion for partial summary judgment." The formal order prepared by counsel for defendant and signed by the court, however, makes no reference to summary judgment and follows the form appropriate for a ruling on a demurrer based upon the face of the complaint.
[8]  We have discovered no case which discusses whether class actions can be employed to recover treble damages for usury, and none in analogous areas of law which bear on this problem. Defendant cites Kline v. Coldwell Banker & Co. (9th Cir.1974) 508 F.2d 226, which refused to permit a class action for treble damages under the antitrust laws. That ruling, however, rests largely on the danger of disproportionate liability if an action for treble damages were permitted against a class of defendants, each of whom would be jointly and severally liable for the whole award; the present case presents no such danger.
[9]  Defendants argue that in a suit for treble damages plaintiffs must allege that they actually paid usurious interest. (See Usury Law, § 2; Heald v. Friis-Hansen, supra, 52 Cal.2d 834, 839.) Paragraphs 14 and 23 of plaintiffs' second amended complaint assert that plaintiffs and other members of their class "paid interest" computed in violation of the Usury Law; those allegations are sufficient to comply with the requirement that plaintiffs specifically plead the payment of illegal interest.
[10]  We reject defendant's suggestion that defining plaintiffs' class in terms of the intent and good faith of the parties necessarily precludes its maintenance as a class action. Plaintiffs may be able to show that defendant, having drafted the customer's agreement, entertained the same intent and good or bad faith toward every member of the class. (See La Sala v. American Sav. & Loan Assn. (1971) 5 Cal.3d 864, 877 [91 Cal. Rptr. 849, 489 P.2d 1113]; Vasquez v. Superior Court (1971) 4 Cal.3d 800, 815 [94 Cal. Rptr. 796, 484 P.2d 964, 53 A.L.R.3d 513].)
[11]  The arguments and evidence presented to the trial court on the motion for class certification were in large part founded upon a misapprehension of the law concerning excessive interest rates in variable-rate contracts. In light of the clarification of those principles in Arneill Ranch v. Petit, supra, 64 Cal. App.3d 277 and in the present opinion, counsel may wish to present additional arguments and evidence before the court rules on the question of certification.
[12]  We express no opinion as to whether plaintiffs' class should be divided into subclasses based upon the presence or absence of a choice of law provision in the contract. That issue was not argued in the briefs or oral presentation before this court.
[1]  The instrument does not contain any promise to pay interest periodically or at any time except insofar as it contains an agreement to pay the "debit balance" upon demand. But even if there were a special provision for payment of interest periodically, I doubt whether the provision would create an ambiguity.
