
107 N.J. 283 (1987)
526 A.2d 1015
STATE OF NEW JERSEY, PLAINTIFF-APPELLANT,
v.
CARLOS RAFAEL SAINZ, DEFENDANT-RESPONDENT.
The Supreme Court of New Jersey.
Argued March 3, 1987.
Decided June 18, 1987.
*285 Jeffrey L. Menkin, Deputy Attorney General, argued the cause for appellant (W. Cary Edwards, Attorney General of New Jersey, attorney).
Louis N. Rainone argued the cause for respondent (Karcher, McDonnell & Rainone, attorneys).
The opinion of the Court was delivered by HANDLER, J.
This appeal raises several issues regarding sentencing for defendants who plead guilty to drug-related offenses. In particular, *286 we must determine whether explicit consideration of aggravating and mitigating factors must be undertaken when a court sentences a defendant for violation of the Controlled Dangerous Substances Act. We also consider the appropriate standards for appellate review of sentences imposed on defendants who plead guilty pursuant to a negotiated plea agreement.
In a search conducted pursuant to a warrant, the police discovered 108.6 grams of cocaine, of which 38 grams were pure free base, at the home of Carlos Rafael Sainz. Sainz and his wife were indicted for possession of one or more ounces of cocaine, including at least 3.5 grams pure free base, N.J.S.A. 24:21-10c(2), and possession of cocaine with intent to distribute, N.J.S.A. 24:21-19b(2).
Sainz agreed to a plea bargain, according to which he would plead guilty to the charge of possession with intent to distribute, the State would move to dismiss the other count against him and both counts against his wife, and the State would recommend a maximum custodial sentence of ten years. Sainz was sentenced to a term of ten years with three years of parole ineligibility, and a $25.00 penalty payable to the Victims Crime Compensation Board. Sainz appealed to the Appellate Division, challenging the validity of the search warrant and the trial court's failure to consider aggravating and mitigating factors in its sentencing decision. The Appellate Division in a reported decision upheld the validity of the search warrant but vacated Sainz's sentence and remanded the case for resentencing. State v. Sainz, 210 N.J. Super. 17 (1986). The State's petition for certification presenting the sentencing issues was granted, and Sainz's cross-petition for certification seeking review of the validity of the search was denied. 104 N.J. 453 (1986).

I.
The sentencing provisions of the Code of Criminal Justice (Code), N.J.S.A. 2C:1-1 to 98-4, are generally applicable to Controlled Dangerous Substances Act (CDS) violations, N.J. *287 S.A. 24:21-1 to -53. The only exceptions are the provisions relating to the degree of a crime. State v. Sobel, 183 N.J. Super. 473 (App.Div. 1982); State v. Tremblay, 185 N.J. Super. 137 (Law Div. 1982). The following language appears in the subsection of the Code dealing with degrees of crimes:
The provisions of this subsection shall not, however, apply to the sentences authorized by the "New Jersey Controlled Dangerous Substances Act," P.L. 1970, c. 226, which shall be continued in effect. A sentence imposed upon violation of the "New Jersey Controlled Dangerous Substances Act" shall be governed by this subtitle [Subtitle 3: Sentencing] but shall be subject to the maximum sentence authorized for the relevant offenses under said act.... [N.J.S.A. 2C:43-1(b).]
Under the Code, the degree of crime has direct relevance to sentencing. An elaborate and integrated scheme correlates crimes to sentencing options. The degree of crime defines its gravity and is the most influential factor in dictating the appropriate sentence. N.J.S.A. 2C:43-1; State v. Roth, 95 N.J. 334 (1984); State v. Hodge, 95 N.J. 369 (1984). The Code has fairly specific standards for determining permissible sentences. For example, a crime of the first degree carries a presumptive term of 15 years and may, depending upon other factors, result in a maximum term of life imprisonment. N.J.S.A. 2C:43-6, 44-1, 44-2. The Code provides further that, in the application of its sentencing scheme, judicial discretion be expressly guided and limited by the determination and weighing of aggravating and mitigating factors. N.J.S.A. 2C:44-1 to -6. It is this process by which the sentencing court determines whether to follow or depart from the presumptive term that is a function of the degree of crime. Thus sentencing discretion under the Code involves an interplay between the degree of crime on the one hand and application of aggravating and mitigating factors on the other. See State v. Roth, supra.
The CDS had different provisions for determining a sentence. The CDS provided for terms of sentences without reference to a *288 degree of crime.[1] For example, possession of cocaine with the intent to distribute, the crime to which Sainz pled guilty, is punishable by imprisonment for up to life, a fine of up to $25,000, or both. N.J.S.A. 24:21-19b(2). Moreover, the CDS contained no express provisions that purport to prescribe standards to guide sentencing discretion. See N.J.S.A. 24:21-19 to -30 (1986 Supp.) (superseded). The narrow issue therefore is not whether Code aggravating and mitigating factors apply to CDS sentencing  they do apply by virtue of N.J.S.A. 2C:43-1(b)  but how these factors are to be used in imposing such sentences given the absence of degrees of crime under CDS to serve as the primary measure for an appropriate sentence.
We consider first the general purpose of aggravating and mitigating factors under the Code. Aggravating and mitigating factors are used to insure that sentencing is individualized without being arbitrary. The factors insure that the sentence imposed is tailored to the individual offender and to the particular crime he or she committed. By establishing under the Code presumptive sentences that could be supplanted only after a finding of a preponderance of aggravating or mitigating factors, the Legislature promoted a uniformity in sentencing practices. See N.J.S.A. 2C:44-1 to -6. Unlike the situation *289 with Code offenses, there were no presumptive sentences for CDS Act violations.[2] Nevertheless, the determination and weighing of aggravating and mitigating factors in CDS cases can serve the same purpose as in the Code. This process can guide judicial discretion and ensure uniformity and consistency in the exercise of this discretion. As observed by the Appellate Division, the determination and weighing of aggravating and mitigating factors is a "critical guideline for arriving at an appropriate sentence for a CDS Act offense[,] [i]n order to reduce unacceptable disparity" in sentencing.[3]Sainz, supra, 210 N.J. Super. at 24.
The further issue in this case is whether the trial court here properly exercised its sentencing discretion. We look first to the actual reasoning of the trial court when it sentenced Sainz to determine to what extent and with what effect it engaged in a consideration of aggravating and mitigating factors. The court in sentencing Sainz stated:
Do you understand what you've done, what this crime is all about, possession of pure free base cocaine with the intent to distribute it? Which means you were readily [sic] willing and able to distribute this poison to other persons without regard to what it might do to them or their family.
You were just here now. You heard this Court sentence a young lady who got in trouble because, at least in part, she was customer of persons like yourself, using that drug, using that controlled dangerous substance, upsetting her life, bringing tragedy to it and to her family.
The maximum sentence available to this Court for this crime is life imprisonment. The Court is asked to accept a plea agreement restricting the Court to only sentencing you to ten years in State's [sic] Prison. This Court rarely touches a presentence report in which there isn't an involvement in controlled dangerous substances, directly or indirectly. So, this poison goes on and on throughout our community, doing damage to the fabric of our community, its people, its families.

*290 Because of those things that have been pointed out to this Court relative to the fact that you do not have a prior record this Court has resolved to accept this plea agreement, but nothing less than the plea agreement. Persons like yourself must be punished.
* * * * * * * *
The Court resolved [sic] to accept the plea agreement, but no less. This is a most serious crime in the eyes of the legislature and in the eyes of this Court. This defendant must be punished for what he did, and his punishment not only be [sic] a deterrence to him, but to other persons.
Therefore, it is the sentence of this Court that the defendant be placed in the custody of the Commissioner of the Department of Corrections for a terms of ten years, with a three year parole disqualifier.
The State argued before the Appellate Division that the trial court's reasoning encompassed an implicit finding and weighing of aggravating and mitigating factors.[4] The State characterizes the trial court as finding three aggravating factors  the offense was a serious one, the offense involved the infliction of serious harm, and the need for deterrence  and one mitigating factor  Sainz had no prior record. See N.J.S.A. 2C:44-1a(1), -1a(2), -1a(9), -1b(7). However, even if it is correct to characterize the trial court's sentence as one based on a weighing of aggravating and mitigating factors, we believe that the determination and weighing of factors under the Code must be much more explicit especially when undertaken in imposing sentences under CDS. Appellate review of sentences under the Code, as well as under Title 24, would become nearly impossible if the appellate courts had to cull lengthy transcripts looking for hints of findings amid other discussions. See State v. Roth, supra; cf. Rule 3:21-4 ("At the time sentence is imposed the judge shall state his reasons for imposing such sentence including his findings pursuant to the criteria for withholding or imposing imprisonment or fines under N.J.S.A. 2C:44-1 to 2C:44-3 and the factual basis supporting his finding *291 of particular aggravating or mitigating factors affecting sentence"). For this sentencing system to work, the trial courts must make their findings of sentencing factors explicit so that the appellate courts can determine in Code cases whether deviations from presumptive sentences were warranted for particular offenders and in CDS cases whether sentencing discretion was soundly exercised.
Because we are uncertain whether the trial court fully considered and weighed the aggravating and mitigating factors set forth in N.J.S.A. 2C:44-1 before imposing sentence on Sainz, Sainz's sentence must be vacated and the case remanded for resentencing.[5]

II.
The three Appellate Division judges disagreed over the appropriate standard for appellate review of sentences imposed on defendants who plead guilty as part of a plea bargain. Judge Brody stated, "If under a plea agreement the prosecutor is to recommend a heavy sentence, he must see to it that the defendant acknowledges having had a role in the crime that will support the sentence." Sainz, supra, 210 N.J. Super. at 25. He was of the view that the defendant's guilty plea itself must provide the factual basis for the sentence, such that the sentence imposed conformed to these facts and fit within the Code's guidelines. Judge Brody suggested that if the State and the defendant wanted to reach a plea agreement inconsistent with the Code's guidelines, the defendant could agree to waive his or her right to appeal. Id. at 27-29.
Judge Fritz wrote separately to emphasize his belief "that the spirit of State v. Spinks, 66 N.J. 568 (1975) should not be abandoned." Id. at 29 (Fritz, J., concurring). He expressed the *292 view that a reviewing court should presume that a plea bargain sentence followed Code sentencing guidelines, though on appeal a defendant could try to rebut that presumption. Id.
Judge Baime's opinion was that as long as there is a credible basis in the entire record for the aggravating and mitigating factors found by the trial court, a reviewing court should uphold the sentence imposed. Id. at 31 (Baime, J., concurring).
The basic standards that guide appellate review of criminal sentences under the Code were set down in State v. Roth, supra, 95 N.J. 334:
[Appellate courts] can (a) review sentences to determine if the legislative policies, here the sentencing guidelines, were violated; (b) review the aggravating and mitigating factors found below to determine whether those factors were based upon competent credible evidence in the record; and (c) determine whether, even though the court sentenced in accordance with the guidelines, nevertheless the application of the guidelines to the facts of this case makes the sentence clearly unreasonable so as to shock the judicial conscience.
[Id. at 364-65.]
These standards apply as well to sentences that result from guilty pleas, including those guilty pleas that are entered as part of a plea agreement. See State v. O'Connor, 105 N.J. 399, 405-08 (1987). Sentences imposed upon such defendants must still be within the sentencing guidelines, and the aggravating and mitigating factors found must still have support in the record.
As we stated earlier, we agree with the Appellate Division that in sentencing for CDS offenses, the trial judge must explicitly determine and weigh aggravating and mitigating factors. However, we disagree with the conclusion, implicit in the Appellate Division's opinion, Sainz, supra, 210 N.J. Super. at 25-26, that the trial court imposing a sentence on a conviction predicated on a guilty plea is limited to "the factual basis the defendant has given or has acknowledged" in finding the sentencing factors.
The essential thing is that the defendant is in fact guilty of the crime for which he is being sentenced. "Since a *293 defendant who pleads guilty or non vult waives his constitutional rights to avoid self-incrimination, to confront his accusers and to secure a jury trial, our court rules are designed to assure, and the cases have uniformly held, that a guilty or non vult plea may not be entered unless the court first satisfies itself that there is a factual basis for the plea and that the plea is made voluntarily and intelligently with an `understanding of the nature of the charge and the consequences of the plea.'" State v. Taylor, 80 N.J. 353, 361-62 (1979) (citations omitted); see Rule 3:9-2. The need to establish a sufficient factual basis for a guilty plea is not obviated by the fact that the plea is part of a negotiated plea agreement. State v. Butler, 89 N.J. 220, 224-25 (1982). The factual basis for a guilty plea must obviously include defendant's admission of guilt of the crime or the acknowledgement of facts constituting the essential elements of the crime. However, the defendant's admission or acknowledgment may be understood in light of all surrounding circumstances. See State v. Heitzman, 209 N.J. Super. 617, 620-21 (App.Div. 1986) (on defendant's motion to set aside his guilty plea, the court can look beyond defendant's admissions); State v. Stackhouse, 194 N.J. Super. 371, 375-76 (App.Div. 1984).
When a trial court imposes a sentence based on defendant's guilty plea, the defendant's admissions or factual version need not be the sole source of information for the court's sentencing decision. We have stated before that the court may look to other evidence in the record when making such determinations, that it should consider "the whole person", and all the circumstances surrounding the commission of the crime. See State v. Marzolf, 79 N.J. 167 (1979); State v. Humphreys, 89 N.J. 4 (1982). What is important  when the court goes beyond defendant's admission or factual version  is that the court not sentence defendant for a crime that is not fairly embraced by the guilty plea. See Sainz, supra, 210 N.J. Super. at 31 (Baime, J., concurring).
*294 In the present case, the trial court could appropriately consider the amount of cocaine found in Sainz's house, the scales and plastic bags found in his house, and the evidence that he drove to Florida to get more cocaine, in determining Sainz's sentence. The court could readily infer in light of these relevant circumstances that when Sainz described himself as someone who was just holding the drugs for someone else, he did so with guilty involvement. The court was not bound to disregard surrounding circumstances and conclude that Sainz was only an innocent holder of the drugs. In the present case, the sentence conformed to the facts, including defendant's admission, and the court did not sentence defendant for a crime to which he had not pleaded guilty. See State v. Marzolf, supra.
We also disagree with the Appellate Division to the extent that its opinion could be interpreted as suggesting that it is either necessary or wise for the State to encourage defendants to waive their rights of appeal as part of a negotiated plea agreement. This Court has held that a defendant may appeal a criminal sentence even if she had agreed to waive the right of appeal as part of a plea agreement. State v. Gibson, 68 N.J. 499 (1975).[6] Also, the waiver should rarely be needed, given the presumption of reasonableness that attaches to criminal sentences imposed on plea bargain defendants.

III.
For the reasons given above, the judgment of the Appellate Division is affirmed.
*295 For Affirmance  Chief Justice WILENTZ and Justices CLIFFORD, HANDLER, POLLOCK, O'HERN, GARIBALDI and STEIN  7.
Opposed  None.
NOTES
[1]  This was changed by The Comprehensive Drug Reform Act of 1986, L. 1987 c. 106, which was signed into law April 23, 1987, to be effective 60 days later. The Sponsor's Statement includes the following language:

[T]he most important feature of this bill is to transfer the criminal offenses currently defined in the "Controlled Dangerous Substances Act" into the more modern "New Jersey Code of Criminal Justice." The consolidation of these offenses and provisions into the penal code will limit courts' sentencing discretion, which will ensure more uniform, consistent and predictable sentencing practices. In contrast to New Jersey's current drug laws, the penal code establishes degrees of offenses and presumptive terms for each degree. This bill clearly establishes the degree and severity of every drug offense, taking into account the nature and dangerousness of the specific controlled substance involved, the amount and purity of that substance, and the defendant's role in the drug distribution hierarchy.
This law does not apply to Sainz, because his case was pending at the time of the law's enactment.
[2]  But see note 1.
[3]  The CDS sentencing process was somewhat unruly, in that it involved the consideration of aggravating and mitigating factors without the guidance of a presumptive sentence. With the passage of the Comprehensive Drug Reform Act of 1986, see supra note 1, the CDS sentencing process will be made more rational.
[4]  The Appellate Division characterized the State's position as denying that aggravating and mitigating factors need be determined and weighed when imposing a CDS sentence. Sainz, supra, 210 N.J. Super. at 23. In its arguments before this Court, however, the State denies that this is its position.
[5]  Though the three judges at the Appellate Division wrote separate opinions, they were unanimous on this conclusion. See Sainz, supra, 210 N.J. Super. at 23-26 (Brody, J.); id. at 29 (Fritz, J.); id. at 30 (Baime, J.).
[6]  The effect of the defendant's appeal in such a case would be to rescind the negotiated agreement. The State would then be free to reinstate charges it had dropped as its part of the agreement. Gibson, supra, 68 N.J. at 511-12.
