In this certiorari case we must interpret section 815.7, The Code, which fixes the standard for compensation of attorneys who are appointed by the court to represent indigent defendants in criminal cases. Plaintiff Gregory A. Hulse, an Adel attorney, brought this action against defendant district Judge Van Wifvat (the district court) to challenge the adequacy of the attorney fee allowed plaintiff for defending Ralph Kuecker, an indigent charged with murder. The questions presented are whether the district court erred in interpreting the statutory requirement of reasonable compensation and in refusing to allow fees for services rendered in the case by plaintiff’s law partner, associate and law clerk. Because we find the court erred in part in interpreting the statutory standard for compensation, we sustain the writ, delineate what we believe to be the correct standard, and remand for further proceedings.
In relevant part, section 815.7 provides:
An attorney appointed by the court to represent any person charged with a crime in this state shall be entitled to a reasonable compensation which shall be the ordinary and customary charges for like services in the community to be decided in each case by a judge of the district court, including such sum or sums as the court may determine are necessary for investigation in the interests of justice .... Only one attorney fee shall be so awarded in any one case except that in class “A” felony cases, two may be authorized.
We have not previously interpreted section 815.7.
Before January 1, 1978, the governing statute was section 775.5, The Code 1977. We interpreted that provision in several cases. See Soldat v. District Court, 283 N.W.2d 497 (Iowa 1979); Parrish v. Denato, 262 N.W.2d 281 (Iowa 1978); Furey v. Crawford County, 208 N.W.2d 15 (Iowa 1973); Woodbury County v. Anderson, 164 N.W.2d 129 (Iowa 1969). In Soldat, we recognized that section 815.7 is a substantive departure from section 775.5. See 283 N.W.2d at 498. However, we did not decide what the difference is. We must now do so.
*709I. The compensation standard. Plaintiff was appointed to represent Kuecker on April 9, 1979. The murder case was tried from June 22, 1979, until July 13, 1979. A mistrial resulted because of the jury’s inability to agree on a verdict. Although a retrial was scheduled, Kuecker entered a plea of guilty to involuntary manslaughter in September 1979 pursuant to a plea bargain with the State.
In his application for fees, plaintiff itemized 494.9 hours of his own time on the case and also requested compensation for 58.6 hours expended by his partner, 221 hours expended by an associate and 14 hours expended by a law clerk. He also sought reimbursement of $2,179.43 in expenses.
Plaintiff and several other attorneys testified in two hearings on the fee application. Testimony was given about plaintiff’s experience and ability, the nature and complexity of the case, trial preparation and strategy, prevailing charges for similar defense work for nonindigents, and other matters which plaintiff and the county considered relevant on the compensation issue. In ruling upon plaintiff’s application, the district court interpreted “ordinary and customary charges for like services in the community,” in section 815.7, to mean “what is charged for the defense of indigent defendants” in the community. In accordance with that standard, the court allowed plaintiff $6250 based on $25 an hour for 250 hours of trial preparation time, $2500 based on $200 a day for twelve and one-half days of trial work, and $2179.43 for expense reimbursement, for a total of $10,929.43. In its final total, the court used $6500 instead of $6250 as the portion of the fee for trial preparation. Because a partial payment of $2000 had previously been made, the court entered an order allowing $9,179.43 as compensation. The court refused to allow any compensation for the services of plaintiff’s partner, associate, and law clerk.
Plaintiff initially contends the court misinterpreted section 815.7. He asserts that the statute entitled him to compensation at the prevailing community rate for nonindi-gent criminal defense services.
This is an issue of law, not of discretion. Applying the correct legal standard, a court has broad discretion in determining attorney fees. See Soldat, 283 N.W.2d at 499. However, ascertaining the correct legal standard is a matter of law. See State v. Lindsey, 302 N.W.2d 98, 101-02 (Iowa 1981).
Two elements inhere in any standard providing for reasonable attorney fees. Both the necessity and valuation of the services must be determined. The services must have been reasonably necessary and the valuation must be reasonable in amount. See In re Estate of Myers, 269 N.W.2d 127, 129 (Iowa 1978) (“the burden is on the applicant for fees to prove the services were reasonably necessary and the charges are reasonable in amount”).
A. Reasonable necessity. In Conway v. Sauk County, 19 Wis.2d 599, 604, 120 N.W.2d 671, 674-75 (1963), the court described the court’s task in determining what services are reasonably necessary:
Determination of the character and extent of the services reasonably necessary requires the careful exercise of judgment. When the court fixes the attorney’s fee after trial, it has certain advantages of hindsight which counsel did not have when he prepared for the defense. All practicing attorneys have shared the experience, however, when the time for billing a client has arrived, of foregoing charges for time hopefully spent in research and investigation on “thin leads” which turned out to be fruitless. This is one of the hazards of the profession. The court should carefully consider the judgment which the attorney exercised in deciding what investigation and preparation would be useful, but the ultimate responsibility rests on the court and it is not bound by the attorney’s decision. The court has the power and duty to take into consideration its own observations of the trial and the facts developed by the evidence.
In a later Wisconsin case the court noted:
Every attorney knows there is no limit to how much preparation one can give a *710lawsuit, but defense counsel must be practical and use good judgment. In such matters he proceeds at his peril.
State v. Kenney, 24 Wis.2d 172, 179-80, 128 N.W.2d 450, 454 (1964).
The district court must exercise independent judgment in determining the extent of reasonably necessary services. See In re Condemnation of Lands, 261 Iowa 146, 153, 153 N.W.2d 706, 710 (1967) (“But counsels’ estimate of the reasonable number of hours necessary for preparation to satisfy their own professional ethics, however commendable, cannot bind the court.”). See also Simon v. Bittner, 288 N.W.2d 549, 552 (Iowa 1980) (“In endeavoring to ascertain a reasonable legal fee, relevant factors include the time necessarily spent by the attorney .... ”). In exercising its independent judgment, however, the court must put itself in the position of a reasonable attorney at the time the services were undertaken. The court must recognize the high standard of diligence and preparation which is demanded of counsel in criminal cases and all of the relevant facts and circumstances in the individual case.
This element in determining reasonable compensation was unaffected by the enactment of section 815.7. The difference between that statute and former section 775.5 relates to valuation of services rather than their necessity. In the present case, no basis appears for finding that the district court did not apply the proper legal standard in determining the extent of plaintiff’s services which were reasonably necessary. Thus, unless an abuse of discretion is demonstrated, we are bound by the court’s determination. Soldat, 283 N.W.2d at 498.
Of the 494.9 hours of his own services itemized by plaintiff, 377.3 hours were consumed in out-of-court research and preparation and the remaining 117.6 hours were spent in court. The court approved 250 hours for preparation and research and converted the court time to twelve and one-half days of trial. Among other grounds for its determination, the court disagreed with counsel concerning the necessity of certain investigative activities and believed that some portion of the time was devoted to plaintiff’s self-education.
We hold that the court employed the correct legal standard and did not abuse its discretion in determining the extent of plaintiff’s services which were reasonably necessary.
B. Valuation. Under former section 775.5, a court-appointed attorney was entitled to “reasonable compensation to be decided in each case by the court.” Counsel is still entitled to reasonable compensation, but under section 815.7 reasonable compensation is “the ordinary and customary charges for like services in the community.” The district court held that “like services” means similar services rendered to indigent defendants pursuant to court appointments. Thus, under the court’s view, the only purpose of the change was to require uniformity in fees paid for indigent defense services. The court then determined plaintiff’s fee based on the allowance of $25 per hour for preparation time and $200 a day for court time.
We separately examine the court’s interpretation of the statute and its valuation of compensation. We first look at the background against which section 815.7 was enacted.
Before 1959, fees were established by statute. See, e. g., § 775.5, The Code 1958. In 1959 the legislature amended section 775.5 to give the district court authority to allow additional fees if necessary in the interest of justice. 1959 Session, 58th G.A., ch. 376, § 1. Section 775.5 was amended again in 1965. This amendment placed the determination of reasonable compensation totally in the district court. 1965 Session, 61st G.A., ch. 449, § 1. We reviewed this history in Furey, 208 N.W.2d at 19.
This court said in Anderson, 164 N.W.2d at 132, that section 775.5 did not purport to provide full compensation and was not intended to permit payment of fees for indigent defense based on what would be charged to nonindigent clients. The court also said: “Its purpose is to insure represen*711tation of an indigent defendant in a criminal case on a basis which would alleviate the financial burden on individual lawyers in light of the developing law of an indigent’s right to counsel under recent decisions of the United States Supreme Court and this court.” Id. These statements were not based on language of the statute or legislative history. Instead they were based on the court’s concept of the duty of attorneys to make financial sacrifices in representing the poor and oppressed.
These statements were not reiterated in Fwey. In that case the court held that an attorney could not bring an independent action against the county to recover compensation under the statute. Requests for compensation were to be made by application to the court in the criminal case. 208 N.W.2d at 18. In specifying the proper procedure, the court said:
The procedure would be simplified, and a better record made for review, if the attorney would also attach a supporting affidavit itemizing time spent and stating facts relevant to the difficulty and importance of the issues involved in the case, the responsibility assumed, his experience and ability, and any other factors important in determining reasonable compensation.
Id. The court cited In re Condemnation of Lands, which listed relevant factors for assessing reasonable compensation in eminent domain cases. 261 Iowa at 152, 153 N.W.2d at 710.
This was the state of the law when section 775.5 was changed as part of the criminal code revision. Soldat and Parrish involved subsequent interpretations of the statute in its unamended form. In Parrish the court did not say the amount of the fee was affected by the defendant’s indigency. Rather, the court said that in determining reasonable compensation under section 775.-5, the district court was to consider the time necessarily spent, the nature and extent of the service, the possible punishment involved, the difficulty of handling and importance of the issues, responsibility assumed and results obtained, the standing and experience of the attorney in the profession, and the customary charges for similar services. 262 N.W.2d at 285. The court thus adapted to criminal cases most of the criteria which are listed in the Iowa Code of Professional Responsibility as general guides for setting reasonable attorney fees. See DR 2-106(B). Although fewer, the factors mentioned in Furey were similar. 208 N.W.2d at 18.
It is significant that in Parrish the court recognized “the customary charge for similar services” as an included factor. 262 N.W.2d at 285. Later, in Soldat, 283 N.W.2d at 498, the court rejected a contention that section 815.7 merely clarified section 775.5. The plaintiff had alleged he was entitled to compensation under section 775.5 based on ordinary and customary charges in the community for nonindigent services. In holding that section 815.7 changed and did not merely clarify section 775.5, the court quoted the statement in Anderson that section 775.5 did not authorize full compensation. 283 N.W.2d at 499.
We now must determine the new valuation standard established in section 815.7. It states in unequivocal terms that reasonable compensation “shall be the ordinary and customary charges for like services in the community.” That change is consistent with the factors affecting reasonable compensation listed in Furey and Parrish. It is inconsistent only with the interpretation of section 775.5 in Anderson and Soldat requiring a discount from full compensation. In changing the law, we believe the legislature intended that reasonable compensation for court-appointed lawyers be set under the criteria which govern reasonable compensation for other litigation services. These are the criteria delineated in DR 2-106(B) which were adapted to criminal cases in Parrish. The effect of this change is to make reasonable compensation full compensation. No discount is now required based on an attorney’s duty to represent the poor.
In reaching this conclusion, we do not minimize an attorney’s ethical obligation to make financial sacrifices in representing *712the poor. We merely hold that the legislature has eliminated this obligation in the defense of indigents in criminal cases under court appointments.
If the legislature intended only to change section 775.5 to provide uniformity in court-appointment fees, the amendment was superfluous. Under our prior cases, reasonable fees for court-appointed services would necessarily be consistent with each other. Procedures were suggested in Furey, 208 N.W.2d at 18, and Parrish, 262 N.W.2d at 287, designed to avoid inequality in fee allowances. Thus, if the new statutory language merely dictated uniformity, it did not change the law.
Moreover, the new language refers to ordinary and customary charges for like services in the community. It does not refer to ordinary and customary fee allowances for similar indigent services. Court-appointment fees are set by the court; they are not fees which are “charged” by counsel. The language plainly refers to fees charged to nonindigent clients in similar litigation.
We thus hold that plaintiff is entitled to full compensation for his reasonably necessary services. The district court erred in holding otherwise. As a result, the method of valuation employed by the court was also flawed.
Although we recognize the convenience of a fixed rate of compensation based on time expended, a rigid adherence to that method of valuation ignores the other factors which must be considered in determining reasonable compensation. True uniformity in compensation can be achieved only when all of the variables affecting reasonableness are considered.
The factors delineated in Parrish are equally relevant under section 815.7. The only difference is that the resulting compensation is not to be reduced based on an attorney’s duty to make financial sacrifices in representing indigents. Because of the background against which section 815.7 was enacted, we arrive at a different conclusion than the Wisconsin court did in interpreting its statute in Kenney, 24 Wis.2d at 180, 128 N.W.2d at 455. However, we agree with the Wisconsin court that certainty of payment from the public treasury is among the factors which should be considered in the valuation task. See State v. DeKeyser, 29 Wis.2d 132, 138, 138 N.W.2d 129, 132 (1965).
We therefore hold that, in addition to the factors delineated in Parrish, the court may consider the certainty of payment as an additional factor. This, however, is just one factor among those which are relevant and should not result, as it did in Wisconsin, in a predetermined percentage discount from what otherwise would be full compensation. In weighing all relevant factors to determine reasonable compensation, the court should simply take into consideration, along with the other factors, the assurance that the fee ordered by the court will be paid.
Upon remand, the court shall consider certainty of payment and all of the Parrish factors in determining an amount which will fully compensate plaintiff for his services as required by section 815.7. Plaintiff and the county shall each have the opportunity to supplement the record made in the prior hearing by offering additional evidence on the valuation issue in light of this holding. See State v. District Court, 286 N.W.2d 22, 25 (Iowa 1979).
II. The request for compensation for the services of others. Plaintiff also contends the district court erred in denying compensation for the services of his law partner, associate, and law clerk. The issue of compensation for legal services of other persons is governed by the statute. Section 815.7 provides: “Only one attorney fee shall be so awarded in any one case except that in class ‘A’ felony cases, two may be authorized.” Because murder is a class “A” felony, the court had authority to appoint a second lawyer to assist plaintiff.
In the hearing on his fee application plaintiff testified:
Q. At one time prior to trial, did you ask the court for the court to appoint an additional attorney to help you in this *713case? A. I never made written application for another attorney to assist; however, the matter was discussed and it was the court’s feeling that it would rather have me do it myself. I think mainly for the reason to hold down further expenses that would come out of this particular trial.
No application for appointment of a second attorney was made. Therefore we have no ruling to review on that issue. We have no occasion to decide whether the court would have abused its discretion in refusing to provide assistance which it was not formally requested to give.
Thus plaintiff obtained legal assistance from other persons without court authority to do so. The statute limits compensation to the services of one attorney unless, in a class “A” felony case, a second attorney is appointed. The issue is not whether the additional services in this case were necessary and valuable but whether they are compensable under the statute. Because plaintiff did not obtain advance authorization from the court for the assistance of a second attorney, we hold that none of the additional services are compensable. See United States v. Nakamura, 577 F.2d 485, 488 (9th Cir. 1978); United States v. Gast, 297 F.Supp. 620, 622 (D.Del.1969); United States v. Naples, 266 F.Supp. 608, 609 (D.D.C.1967); People v. Elliot, 98 Misc.2d 424, 428-29, 413 N.Y.S.2d 1001, 1006 (1979). The statute in People v. Atkinson, 50 Ill.App.3d 860, 8 Ill.Dec. 932, 366 N.E.2d 94 (1977), did not impose a limitation like that in section 815.7.
The court did not err in refusing to allow compensation for the legal services of persons other than plaintiff.
III. Problems inherent in the present fee system. The right of indigents to representation at public expense is a matter of constitutional mandate. Providing counsel under section 815.7 is one method of complying with this constitutional requirement. In this system, the legislature has granted judges the authority to control the expenditure of county funds for court-appointment fees. County officials operate under tight budgets with limited resources. The extent of court-appointment services in a given year is a direct result of the number of prosecutions during that period. Neither the number or kind of prosecutions can be predicted in advance. However, a steady and substantial growth in volume has occurred. In 1956, 6,178 regular district court criminal cases were initiated. By 1980 this figure had increased almost six hundred percent to 35,669 cases. These cases comprise almost forty percent of the caseload of the district courts. The majority of them require services of court-appointed lawyers. Like so many other budgetary problems, this one is also aggravated by the ravages of inflation. This creates a difficult problem both for the courts and counties.
Now the legislature has provided in section 815.7 that lawyers, like all other persons who provide services to indigents at public expense, are entitled to full compensation for their services. It is understandable that this change would increase tension at the local level. Sensitivity to the legitimate concerns of county officials makes the responsibility of the district courts to determine court-appointment fees even more difficult. Nevertheless, the legislature established a valuation standard requiring full compensation. The district courts must follow the statute. This does not abrogate their duty, however, to allow fees only for necessary services, nor does it prevent the court from guarding against expansion of services based on the assurance of payment from the public treasury.
We have recognized that the burden of indigent criminal defense work falls upon a small segment of the bar, rather than all lawyers, as was originally intended. Soldat, 283 N.W.2d at 500. Demands of constitutional and statutory law have vastly increased the difficulty and complexity of criminal cases. Questions of effectiveness of counsel are common. Lawyers must make special efforts to achieve the level of ability which is necessary to provide the requisite standard of representation. These efforts involve substantial investments of time, expense, education and experience. *714Although we encourage more lawyers to accept this burden, the nature and extent of the burden make it unlikely enough of them will be able to do so. Furthermore, the segment of the bar which is available for these services no longer suffers only from minor inroads into regular practice. The explosion of volume means that some lawyers must devote nearly all their professional time to work under court appointments. These realities may have led to the change in the statute.
The legislature has provided boards of supervisors with an alternative to the court-appointment system. Under chapter 336A, they may establish a county or multicounty public defender office. In that situation, counsel receive full compensation for their services and the salaries are fixed by the boards of supervisors. § 336A.5. This alternative does not change the source of funds for indigent defense work, but it gives local officials greater control over budgeting.
Other alternatives and recommendations for improvement of the present system of providing indigent defense services in Iowa are discussed in Indigent Defense in Iowa (1980), a study report of the Iowa Crime Commission. These proposals deserve serious consideration by all persons who are concerned with the cost-effective delivery of these constitutionally mandated legal services.
We sustain the writ of certiorari in the present action and remand the case to the district court for additional proceedings in accordance with this opinion.
WRIT SUSTAINED; REMANDED.
All justices concur except LeGRAND, HARRIS, and McGIVERIN, JJ., who dissent, and REYNOLDSON, C. J., who takes no part.