
520 N.W.2d 33 (1994)
2 Neb. App. 1008
STATE of Nebraska, Appellee,
v.
Carlos R. SANCHEZ, also known as Roberto Jarvio, Appellant.
No. A-93-1084.
Court of Appeals of Nebraska.
August 2, 1994.
*34 Jerry J. Fogarty, Deputy Hall County Public Defender, for appellant.
Don Stenberg, Atty. Gen., and Delores Coe-Barbee, Lincoln, for appellee.
IRWIN, MILLER-LERMAN and MUES, JJ.
IRWIN, Judge.

I. INTRODUCTION
On September 29, 1993, Carlos R. Sanchez, also known as Roberto Jarvio, was charged in an amended information with two felonies: robbery, a Class II felony, Neb.Rev.Stat. § 28-324 (Reissue 1989); and assault in the first degree, a Class III felony, Neb.Rev. Stat. § 28-308 (Reissue 1989). Sanchez pled guilty to both charges and was subsequently sentenced on November 2, 1993. On the robbery conviction, Sanchez received a term of not less than 16 nor more than 50 years' imprisonment and was granted credit against the maximum term for time served prior to the sentencing. He received a term of not less than 6 nor more than 20 years' imprisonment for the assault. Both sentences were the maximum allowable under state law and were ordered to be served consecutively.
Because credit for time served was granted against the robbery sentence and the sentences were not excessive, we affirm the convictions and sentences in all regards except the robbery sentence, which we modify to apply credit for time served against the minimum term in addition to the maximum term.

II. FACTUAL BACKGROUND
On March 20, 1993, Sanchez and his girl friend, Denise Ong, established a plan to commit a robbery. Per the plan, Ong went to a tavern in Grand Island to find a victim. At the tavern, Ong met Lyle and Judy Tibbs. After Ong informed the Tibbses she had no place to stay, the Tibbses invited her to stay *35 at their home. When the Tibbses and Ong left the tavern, Sanchez followed them without the Tibbses' knowledge. After arriving at the Tibbses' home, Sanchez rang the doorbell. When Judy Tibbs answered the door, Sanchez knocked her over a couch and shot Lyle Tibbs in the leg. After a struggle, Sanchez pistol-whipped Lyle Tibbs.
Sanchez and Ong proceeded to handcuff the Tibbses, wrap duct tape around their mouths, and rob the victims of money, jewelry, guns, and other items. After Sanchez threatened to kill the Tibbses if they told anyone about the offense, he and Ong fled the scene. They were arrested on March 30, 1993, in Loveland, Colorado.
Sanchez has a prior record of burglary, robbery, drug possession, and assault, all since 1987. While on probation for possession of heroin, he was convicted of robbery and burglary and was sentenced to 6 years in the Mississippi State Penitentiary.
In the instant case, Sanchez was originally charged with attempted second degree murder, robbery, and use of a weapon in the commission of a felony. The complaint was amended following plea negotiations. On September 29, 1993, Sanchez was charged in an amended information with robbery and assault in the first degree. Sanchez pled guilty to both charges and was subsequently sentenced on November 2, 1993.
The trial court ordered that the two sentences be served consecutively. Sanchez had been incarcerated from March 30, 1993, through the sentencing date and was granted credit for his time served against the maximum term in the robbery sentence. No credit was granted against the assault sentence.

III. ASSIGNMENTS OF ERROR
Sanchez assigns three errors. The first is that the trial court erred in failing to grant credit, as required by Neb.Rev.Stat. § 83-1,106 (Supp.1993), for time served against the minimum term as well as the maximum term imposed on the robbery charge. The second assigned error is that the trial court erred in failing to grant credit for time served against both the minimum and maximum sentence imposed on the assault charge in addition to the credit granted on the robbery charge. The final assignment of error is the excessiveness of the sentences.

IV. STANDARD OF REVIEW
Regarding questions of law, an appellate court has an obligation to reach an independent, correct conclusion. State Farm Mut. Auto. Ins. Co. v. Hildebrand, 243 Neb. 743, 502 N.W.2d 469 (1993).

V. ANALYSIS
As noted above, there are two issues involving the granting of credit for the period of time spent in presentence confinement. The first issue is whether credit must be granted against both the minimum term and the maximum term of a sentence. The second issue is whether the credit should be granted against each sentence where there are two or more sentences to be served consecutively.

1. CREDIT FOR MINIMUM AND MAXIMUM TERMS
Section 83-1,106 requires the sentencing court to grant credit for time served against a defendant's sentence. Section 83-1,106(1) provides:
(1) Credit against the maximum term and any minimum term shall be given to an offender for time spent in custody as a result of the criminal charge for which a prison sentence is imposed or as a result of the conduct on which such a charge is based. This shall specifically include, but shall not be limited to, time spent in custody prior to trial, during trial, pending sentence, pending the resolution of an appeal, and prior to delivery of the offender to the custody of the Department of Correctional Services, the county board of corrections, or, in counties which do not have a county board of corrections, the county sheriff.
(Emphasis supplied.)
In its brief, the State concedes that § 83-1,106(1) clearly requires that credit for time served be given against the minimum term as well as the maximum term in a sentence. We find that the sentence on the robbery charge must be modified to grant credit *36 against the minimum as well as the maximum term.

2. DOUBLE CREDIT
Prior to its amendment in 1988, § 83-1,106 provided that credit for time served "may be given." It was within the sentencing court's discretion whether to grant credit. State v. Von Dorn, 234 Neb. 93, 449 N.W.2d 530 (1989). However, under case law prior to 1988, the courts were required to grant credit for time served when the sentence imposed was the maximum allowable for the offense. This prevented the person from serving more than the maximum term. Id.
The 1988 amendment of § 83-1,106 changed "may be given" to "shall be given," thus removing the discretion of the courts in granting credit for time served. 1988 Neb.Laws, L.B. 1054. Since the amendment, there have been no appellate cases in this state addressing the issue of whether credit must be applied to each sentence where there are multiple, consecutive sentences. However, the Nebraska Supreme Court did face a preamendment case with a similar fact pattern in State v. Vrtiska, 227 Neb. 600, 418 N.W.2d 758 (1988).
Vrtiska was incarcerated on September 1, 1985, for two separate concealed weapon charges. On April 17, 1986, he was sentenced to the maximum term on the first charge and granted 200 days credit for time served. Vrtiska was sentenced on May 23, 1986, on the second charge and received the maximum term, but no credit for time served. The second sentence was ordered to be served consecutively to the first sentence. Vrtiska appealed the second sentence, claiming that proper credit for time served was not given.
The Supreme Court found that 229 days of credit, the period from September 1, 1985, to the sentencing on April 17, 1986, must be granted because maximum sentences had been given. The court held that since only 200 days of credit had been granted on the first sentence, the remaining 29 days of credit were to be applied against the second sentence. However, the court did not interpret § 83-1,106 to mean that the entire 229 days of credit had to be applied to each sentence.
In the present case, Sanchez argues that because § 83-1,106(1) provides for the granting of credit "for time spent in custody as a result of the criminal charge for which a prison sentence is imposed," he should receive credit against both sentences. Sanchez contends that because he spent time in custody as a result of both charges, he should receive credit against both sentences.
The statutory text that Sanchez quotes was not changed in the 1988 amendment. It remains exactly the same as when the court decided Vrtiska. If the correct interpretation of § 83-1,106(1) is as Sanchez argues, the court in Vrtiska would have applied 229 days of credit against each sentence, rather than applying it against the aggregate of the two sentences.
Courts in other states, construing statutes similar to § 83-1,106, have uniformly held that
when consecutive sentences are imposed for two or more offenses, periods of presentence incarceration may be credited only against the aggregate of all terms imposed: an offender who receives consecutive sentences is entitled to credit against only the first sentence imposed, while an offender sentenced to concurrent terms in effect receives credit against each sentence.
Endell v. Johnson, 738 P.2d 769, 771 (Alaska App.1987). See, State v. Percy, 158 Vt. 410, 612 A.2d 1119 (1992); People v. Watts, 186 Mich.App. 686, 464 N.W.2d 715 (1991); State v. Miranda, 108 N.M. 789, 779 P.2d 976 (1989); Nissel v. Pearce, 307 Or. 102, 764 P.2d 224 (1988); State v. Cuen, 158 Ariz. 86, 761 P.2d 160 (Ariz.App.1988); State v. Riley, 761 S.W.2d 745 (Mo.App.1988); People v. Pluskis, 162 Ill.App.3d 449, 113 Ill.Dec. 671, 515 N.E.2d 480 (1987); State v. Arcand, 403 N.W.2d 23 (N.D.1987); Effinger v. State, 380 N.W.2d 483 (Minn.1986); Schubert v. People, 698 P.2d 788 (Colo.1985); State v. Decker, 127 N.H. 468, 503 A.2d 796 (1985); State v. Jenkins, 10 Kan.App.2d 8, 690 P.2d 396 (1984); State v. Hoch, 102 Idaho 351, 630 P.2d 143 (1981); Simms v. State, 421 N.E.2d 698 (Ind.App.1981); People v. Brown, 107 Cal.App.3d 858, 166 Cal.Rptr. 144 (1980); *37 Com. v. Carter, 10 Mass.App.Ct. 618, 411 N.E.2d 184 (1980); State v. Richardson, 295 N.C. 309, 245 S.E.2d 754 (1978); Wilson v. State, 82 Wis.2d 657, 264 N.W.2d 234 (1978); Miller v. State, 297 So.2d 36 (Fla.App.1974); Holland v. State, 13 Md.App. 635, 284 A.2d 874 (1971); State v. Johnson, 167 N.W.2d 696 (Iowa 1969).
The purpose of statutes which require the granting of credit for presentence incarceration is to assure that the equal protection rights of indigent defendants who cannot afford to post bond are not violated. Without credit for time served, the total period of confinement served by an indigent defendant would be more than that of a defendant who could afford to post bond. However, once credit has been granted, "there is no additional constitutional purpose to be served by granting a second or `double credit' against a later consecutive sentence." Cuen, 158 Ariz. at 88, 761 P.2d at 162. See, also, Nissel, supra; Carter, supra.
Furthermore, to construe § 83-1,106(1) to mean that credit should be granted against each consecutive sentence would actually penalize those who could afford to post bail. The offender who posted bail and then received consecutive sentences would be imprisoned for a longer total period of time than an offender who could not post bail. The one who posted bail would have to serve the full length of the terms of the sentences, while the one who did not post bail would be entitled to credit against each of the sentences. See, Endell, supra; Simms, supra; Carter, supra. In the present case, if double credit were granted to Sanchez, he would serve 218 fewer days than if he had made bail. This would not seem to be a result intended by the Legislature, as this construction of the statute would tend to defeat the purpose of consecutive sentencing.
Credit for presentence incarceration is properly granted only against the aggregate of all terms imposed. The total length of time to be served under the sentences is reduced by the time already served before sentencing. Where concurrent sentences are given, credit is, in effect, applied against each sentence. This must be done because the term of the longest sentence determines the total length of time the person is held. However, the end result is the same as in the consecutive sentence situation where credit is applied against only the first sentence. The total time to be served under the sentences is reduced by the time served before sentencing.

3. EXCESSIVENESS OF SENTENCES
In the final assignment of error, Sanchez argues that the sentences imposed by the trial court were excessive. The general rule followed by Nebraska appellate courts is that "a sentence imposed within the limits prescribed by statute will not be set aside as excessive absent an abuse of discretion." State v. Haynie, 239 Neb. 478, 490, 476 N.W.2d 905, 914 (1991). Accord State v. Nevels, 235 Neb. 39, 453 N.W.2d 579 (1990). "It is also within the trial court's discretion to direct that sentences imposed for separate crimes be served consecutively." Haynie, 239 Neb. at 490, 476 N.W.2d at 914. Accord State v. Zaritz, 235 Neb. 599, 456 N.W.2d 479 (1990). "Moreover, as a practical matter, it is the minimum portion of an indeterminate sentence which measures its severity." State v. Stephens, 237 Neb. 551, 559, 466 N.W.2d 781, 787 (1991). Accord Nevels, supra.
"In imposing a sentence, a sentencing judge should consider the defendant's age, mentality, education, experience, and social and cultural background, as well as his or her past criminal record or law-abiding conduct, motivation for the offense, nature of the offense, and the amount of violence involved in the commission of the crime."
State v. Smith, 242 Neb. 202, 207, 494 N.W.2d 126, 129 (1993). Accord Nevels, supra. Sanchez contends that the trial court abused its discretion by not taking these factors into consideration when sentencing him, resulting in excessive sentences.
A review of the record shows that prior to sentencing Sanchez, the court stated:
Mr. Sanchez, in pronouncing your sentence, I have considered the presentence investigation report ... what the county attorney has said [and] what your counsel has said. I have considered your age, the type of crime you have been convicted of, the degree of your involvement in that *38 crime or crimes, the presence or absence of violence, your prior criminal history. I have considered your social and cultural background, your experiences in life, your education, your mentality.
Both sentences imposed on Sanchez are within the statutory limits, and it is within the trial court's discretion to impose consecutive sentences. Furthermore, as evidenced by the record excerpt, the trial judge considered all pertinent factors before imposing the sentences. We find no abuse of discretion.

VI. CONCLUSION
We modify Sanchez' robbery sentence to apply credit for his presentence incarceration against the minimum term in addition to the maximum term. The trial court correctly applied credit only against Sanchez' robbery sentence, the first of the two consecutive sentences. The judgment is affirmed as modified.
AFFIRMED AS MODIFIED.
