
105 Ariz. 504 (1970)
467 P.2d 749
The STATE of Arizona, Appellee,
v.
James L. CARPENTER, Appellant.
No. 1884.
Supreme Court of Arizona, In Banc.
April 8, 1970.
Gary K. Nelson, Atty. Gen., William J. Schafer, III, former Pima County Atty., Rose S. Silver, Pima County Atty., by Fred N. Belman, Deputy County Atty., for appellee.
Erik M. O'Dowd, Tucson, for appellant.
James L. Carpenter, pro se.
McFARLAND, Justice.
James L. Carpenter, hereinafter referred to as defendant, was charged in Count I with the crime of kidnapping; Count II with the crime of robbery of Malcolm Mills while armed with a deadly weapon  in violation of § 13-641 and § 13-643, subsec. B, A.R.S., as amended; Count III with the crime of grand theft while armed with a deadly weapon. He entered his plea of guilty to Count II, and upon motion of the county attorney Count I and Count III were dismissed. He was sentenced to a term of not less than twenty years nor more than thirty years in the Arizona State Penitentiary. From the judgment and sentence he appeals.
Defendant was represented by counsel at the time of his arraignment, at the time he entered his plea, and also upon this appeal. *505 His present counsel certified that he has reviewed the entire transcript of record on appeal, and finds no substantial error in the proceedings below. He states that he sent a copy thereof, together with a copy of the entire transcript of record on appeal to defendant. Counsel also requests this Court to review the record for fundamental error, and permit the defendant an opportunity to submit briefs on appeal in his own behalf. Counsel, in conformity with Anders v. California, 386 U.S. 738, 87 S.Ct. 1396, 18 L.Ed.2d 493, set forth the matters which he stated might arguably support the appeal  that the defendant was sentenced under the provision of § 13-643, subsec. B, A.R.S., as amended, for a first offense, and was not told that if he were convicted of a future offense the imposition of sentence would be a minimum of ten years in prison. Counsel also stated that defendant was not fully apprized of the consequences of his guilty plea, and that he should now have an opportunity to withdraw his plea and enter a plea of not guilty as charged. He further states that at the time of the entry of the plea of guilty defense counsel and the prosecuting attorney had an arrangement whereby if defendant would plead guilty to Count II the county attorney would dismiss Counts I and III.
The defendant, in a letter which he stated was at the request of his attorney, submitted as error the matters contained in the minute entries. First, in regard to the complaint presumably referring to the charge of a violation of § 13-641 and § 13-643, subsec. B. In support of his contention he called attention to the transcript of the proceedings setting forth the colloquy between the judge and the county attorney as to the section under which defendant should be sentenced. The last contention was that the sentence was excessive. As per his request, his letter was made part of the record.
Both matters referred to by counsel and by defendant in propria persona are involved in what is usually termed "plea bargaining" and whether the proper safeguards were followed in the acceptance of the plea. The record shows that the court followed the safeguards necessary for a determination as to the voluntariness of the plea and a determination of whether the defendant understood the nature and consequences of the plea. The court carefully questioned defendant in order to make these determinations.
The court, in determining for itself that the defendant understood the constitutional rights which he was waiving, advised defendant that he had the right to trial by jury, and asked defendant if he wished to waive such right, to which defendant replied in the affirmative. The court read the statutes  § 13-641 and § 13-643, subsec. B  and explained them. This answers the matter raised by defendant that he was not advised of the fact that a future offense carries a minimum ten-year sentence. The court also asked defendant if he admitted to the robbery, to which the reply was "yes, sir."
With regard to voluntariness the record shows the following:
"THE COURT: Has anybody coerced you or threatened you in any way in order to change your plea?
"MR. CARPENTER: No, sir.
"THE COURT: Has anybody promised you that the Court would be lenient to you?
"MR. CARPENTER: No, sir.
"THE COURT: Has anybody said to you that if you plead guilty to this, the Court will put you on probation and not send you to the state prison?
"MR. CARPENTER: No, sir.
"THE COURT: Has there been some arrangement, gentlemen? I'm asking you two, has there been some plea agreement of some kind?
"MR. WALKER: Yes.
"THE COURT: What was that agreement?

*506 "MR. WALKER: That agreement was if there was a plea of guilty to Count 2, that the other two counts would be dismissed as far as the County Attorney is concerned.
"THE COURT: This all involves the same person?
"MR. CRISMON: Yes, it does involve the same person.
"THE COURT: And the same acts?
"MR. CRISMON: The same acts. The kidnapping arose out of the robbery itself.
"THE COURT: That's what your agreement is, Mr. Crismon?
"MR. CRISMON: Yes, Your Honor, it was our understanding that if he did plead guilty to this, we would dismiss the other two charges.
"THE COURT: Let me ask Mr. Carpenter, are you satisfied with the services that your attorney has rendered you you in this case?
"MR. CARPENTER: Definitely."
In order to determine that the defendant understood the potential consequences of his plea the court advised defendant of the minimum and maximum sentence which it could impose, and repeated this explanation several times, stating that he could receive anywhere from five years to life, or anything in between. It was only after all of this that the court allowed the plea to be entered.
In regard to the colloquy, at the sentencing, after the request by the county attorney that defendant be sentenced under § 13-643, subsec. B, A.R.S., as though it were a first offense, the defendant's counsel stated that that was his motion. The court stated that the record would so reflect, in order that there would be no misunderstanding as to the consequences of the plea. The judge also repeated his advice that the minimum sentence which could be imposed is five years, and asked defendant if he wished to withdraw his guilty plea, to which defendant replied "No, I don't."
It has been recognized by the courts, including this Court, that the better rule is to permit plea bargaining under the proper safeguards  that it is frequently to the best interests of both the State and the accused. State v. Jennings, 104 Ariz. 3, 448 P.2d 59; Commonwealth ex rel. Kerekes v. Maroney, 423 Pa. 337, 223 A.2d 699. The defendant in the instant case secured a dismissal of two counts, and at the insistence of his attorney was sentenced as though it were his first offense  despite the fact that the court at the time of sentencing referred to the bad record of the defendant. The State benefitted by the elimination of the expense of a trial. The record shows that the safeguards in plea bargaining were carefully adhered to by the trial court. The judge personally inquired into defendant's understanding of the nature of the charge and the consequences of the plea, and satisfied himself that there was a factual basis for the plea. McCarthy v. United States, 394 U.S. 459, 89 S.Ct. 1166, 22 L.Ed.2d 418; Boykin v. Alabama, 395 U.S. 238, 89 S.Ct. 1709, 23 L.Ed.2d 274.
In regard to defendant's contention that the sentence was excessive, this Court has held that the trial court has a wide discretion in the pronouncing of a sentence, and that it will uphold a sentence if it is within the statutory limits unless there is a clear abuse of discretion. State v. Bradley, 99 Ariz. 328, 409 P.2d 35. We find no abuse of discretion of the court in the instant case.
The "arguable" matters raised by defendant and his counsel are without merit. In accordance with the rule in Anders v. California, supra, we have carefully studied the record in the instant case, and find no fundamental error in any of the proceedings. Judgment affirmed.
LOCKWOOD, C.J., STRUCKMEYER, V.C.J., and UDALL and HAYS, JJ., concur.
