delivered the opinion of the court:
In a bench trial in the circuit court of Montgomery County, the defendant, Michael L. Rege, was found guilty of possession of more than 500 grams of a substance containing cannabis in violation of the Cannabis Control Act (Ill. Rev. Stat. 1973, ch. 56x/2, par. 704(e)). At the conclusion of a presentence hearing, the trial court denied the defendant’s motion for probation and imposed a sentence of 1 to 3 years in the penitentiary. On appeal, the appellate court affirmed the conviction but remanded the cause to the trial court with directions to vacate the sentence and to grant the defendant probation under such terms and conditions as it should determine. (People v. Rege (1975), 30 Ill. App. 3d 127.) We allowed separate petitions for leave to appeal filed by the People (No. 47850) and by the defendant (No. 47864) and have consolidated them for opinion in this court.
Defendant’s initial contention is that his conviction must be reversed on the ground that the indictment failed to charge him with an offense and was therefore void. Section 4(e) of the Cannabis Control Act provides in pertinent part:
“It is unlawful for any person knowingly to possess *477cannabis. Any person who violates this section with respect to:
(e) more than 500 grams of any substance containing cannabis is guilty of a Class 3 felony.” (Ill. Rev. Stat. 1973, ch. 56y2, par. 704(e).)
“Cannabis” is defined by the statute as follows:
“ ‘Cannabis’ includes marihuana, hashish and other substances which are identified as including any parts of the plant Cannabis Sativa, whether growing or not; the seeds thereof, the resin extracted from any part of such plant; and any compound, manufacture, salt, derivative, mixture, or preparation of such plant, its seeds, or resin, including tetrahydrocannabinol (THC) and all other cannabinol derivatives, including its naturally occurring or synthetically produced ingredients, whether produced directly or indirectly by extraction, or independently by means of chemical synthesis or by a combination of extraction and chemical synthesis; but shall not include the mature stalks of such plant, fiber produced from such stalks, oil or cake made from the seeds of such plant, any other compound, manufacture, salt, derivative, mixture, or preparation of such mature stalks (except the resin extracted therefrom), fiber, oil or cake, or the sterilized seed of such plant which is incapable of germination.” (Ill. Rev. Stat. 1973, ch. 5614, par. 703(a).)
The indictment returned by the Montgomery County grand jury charged:
“That on the 12th Day of April, 1973, in Montgomery County, Illinois, MICHAEL L. REGE committed the offense of UNLAWFUL POSSESSION OF CANNABIS in that Michael L. Rege did knowingly and unlawfully have in his possession more than five hundred (500) grams of a substance containing Cannabis, otherwise than as authorized in the Cannabis Control Act in violation of Chapter 5614 Paragraph 704(e), Illinois Revised Statutes, which is Section 4(e) of the Cannabis Control Act.”
The defendant argues that cannabis exists in various forms and that the Cannabis Control Act evidences a legislative intent to proscribe only natural substances derived from the plant Cannabis Sativa and certain other *478synthetically or chemically produced substances, excepting therefrom particular parts, such as the mature stalks, and products made therefrom. He contends that the indictment in this case failed to charge him with possession of a particular kind and quality of cannabis prohibited by the statute for which reason the indictment was void and the trial court was without jurisdiction.
Since the sufficiency of the indictment was challenged by defendant for the first time in the appellate court, we need not determine whether the indictment could withstand a pretrial motion to dismiss or a post-trial motion in arrest of judgment for failure to state an offense. Failure of an indictment to allege all elements of an offense does not serve to deprive the circuit court of jurisdiction (People v. Gilmore (1976), 63 Ill. 2d 23), nor does it necessarily render the indictment void (People v. Pujoue (1975), 61 Ill. 2d 335). As we held recently in the Pujoue and Gilmore cases, an indictment or information attacked for the first time on appeal is sufficient if it apprised the accused of the precise offense charged with sufficient specificity to prepare his defense and allow the pleading of a resulting conviction as a bar to future prosecution arising out of the same conduct.
Application of the foregoing test to this case leads us to conclude that the indictment was sufficient in both respects. The indictment charged that on a certain date in Montgomery County, Illinois, the defendant possessed more than 500 grams of a substance containing cannabis in violation of a specific provision of the Cannabis Control Act. Defendant does not suggest in what manner his defense was prejudiced by failure, of the indictment to more particularly identify the substance he allegedly possessed, and our examination of the record discloses no such prejudice. It is apparent that prior to and during the trial there was never any question or doubt about the fact that defendant was being tried for unlawful possession of marijuana and hashish in violation of the Cannabis Control *479Act. The record also clearly shows that the offense of which defendant was convicted was specifically identifiable and could be pleaded in bar of subsequent prosecutions. See also People v. Yeargain (1954), 3 Ill. 2d 25.
At trial there was evidence that on April 12, 1973, at 1:25 p.m., defendant was stopped by State Police troopers on U.S. Route 66 for driving 80 miles per hour in a 70 mile per hour zone. The troopers testified that they smelled “an odor of marijuana” inside the driving compartment of the car and also detected “a rather strong odor of marijuana” when defendant opened the trunk of the car. The troopers recovered a brown paper sack from the trunk which was found to contain what the troopers believed to be “a quantity of marijuana.” At about the time the troopers were examining the contents of the paper bag, defendant said “there is no hard stuff there” and also stated “and that is all the grass I got.” While en route to police headquarters, defendant told the troopers “this was the first time I ever transported any marijuana like this.” According to the troopers, defendant “also made the statement that this was his grass and that it was his summer stash.” The troopers further testified that to their knowledge “grass,” “cannabis” and “marijuana” were one and the same. The State proceeded to introduce into evidence various exhibits taken from the trunk of defendant’s car, including a number of cellophane bags, a glass bottle and a portion of a “brick,” the contents of which had been analyzed at the Springfield Crime Laboratory. In his testimony, the analyst described the chemical and microscopic tests he performed on the vegetable material in the various containers. He testified that both tests revealed the presence of cannabis in each of the containers he tested and that the total weight of cannabis found in seven specified exhibits was 707.1 grams.
Defendant contends that the foregoing evidence was insufficient to prove beyond a reasonable doubt that he possessed a form of cannabis proscribed by section 4(e) of *480the Cannabis Control Act. In this regard, he relies primarily on the fact that the analyst who tested the substances testified merely that the substances contained “cannabis” without further identifying them as containing marijuana, hashish, parts of the plant Cannabis Sativa and the like. This argument is again based on the premise that cannabis is polytypical and that the Cannabis Control Act proscribes certain forms of cannabis but not others. We believe, however, that in any event there was sufficient evidence in the record before us to sustain the conviction. The testimony concerning the laboratory test findings was not the only evidence relative to the nature of the substances recovered from the car. Additional evidence included the testimony as to defendant’s own admissions, establishing that defendant was in possession of marijuana, which is specifically included within the statutory definition of cannabis.
The appellate court concluded from its review of the evidence adduced at the presentence hearing that the interests of the defendant and society would best be served by probationary supervision rather than imprisonment. It was on this basis that the court vacated the sentence of imprisonment and remanded the cause to the trial court with directions to grant the defendant probation. In so holding, the court relied upon its earlier opinion in People v. Rednour (1974), 24 Ill. App. 3d 1072, which found that under the newly adopted Unified Code of Corrections a reviewing court was no longer precluded from reducing a sentence of imprisonment to a sentence of probation in cases where a trial court has abused its discretion in denying a defendant’s request for probation. The People contend that the appellate court exceeded its authority in this regard.
We held under the former Code of Criminal Procedure that whether a defendant should be granted probation is a matter within the discretion of the trial court, and that appellate review of the denial of probation is limited to *481determining whether the trial court did, in fact, exercise its discretion or whether it abused that discretion by acting in an arbitrary manner. (See People ex rel. Ward v. Moran (1973), 54 Ill. 2d 552, and cases cited therein.) Following adoption of the Unified Code of Corrections, and prior to this court’s decision in People v. Bolyard (1975), 61 Ill. 2d 583, divergent views were expressed in appellate court decisions whether, under that code, reviewing courts had authority to reduce a sentence of imprisonment to probation in the event it is determined that the trial court failed to exercise discretion or abused its discretion by arbitrarily denying probation. (Compare People v. Rednour (1974), 24 Ill. App. 3d 1072; People v. Rege (1975), 30 Ill. App. 3d 127, with People v. Meyer (1975), 30 Ill. App. 3d 673; People v. Cross (1975), 27 Ill. App. 3d 785; People v. Carlton (1975), 26 Ill. App. 3d 995.) That question was settled by Bolyard.
There we reexamined, under the Unified Code of Corrections, the issue originally decided in Moran and held that the trial judge had arbitrarily denied probation. The defendant had requested that we modify his sentence and grant probation under the authority of Supreme Court Rule 615, contending that the Moran decision was no longer controlling under the Unified Code of Corrections, which recognized probation as a sentence, whereas under the prior law it was not so recognized. We rejected that contention and concluded that the Moran decision should be adhered to, since the rationale of that case was as applicable under the Unified Code of Corrections as under the prior law. We also stated: “We further note that the court which is charged with the responsibility of sentencing is empowered to conduct an evidentiary hearing to gather the information required for a reasoned judgment. This judgment is based upon the circumstances of each case, including such factors as the demeanor of the witnesses and their credibility. We find that such factors can more properly be considered by the trial court.” (61 *482Ill. 2d 583, 589.) As in Moran, we concluded that Rule 615 does not grant a reviewing court the authority to reduce a sentence of imprisonment to probation. Accordingly, we remanded the cause to the trial court for resentencing by a judge other than the trial judge.
Bolyard is determinative here, and we accordingly hold that the appellate court erred in remanding the cause with directions to grant probation. The question still remains, however, as to whether it is nevertheless necessary to remand the cause to the trial court for resentencing by a judge other than the trial judge on the grounds that the trial court arbitrarily denied defendant’s motion for probation.
Section 5 — 6—1 of the Unified Code of Corrections specifies the following factors which the trial judge should consider in determining whether to impose a term of imprisonment or a period or probation:
“(a) The court shall impose a sentence of imprisonment upon an offender if, having regard to the nature and circumstance of the offense, and to the history, character and condition of the offender, the court is of the opinion that:
(1) his imprisonment is necessary for the protection of the public; or
(2) the offender is in need of correctional treatment that can most effectively be provided by a sentence to imprisonment; or
(3) probation or conditional discharge would deprecate seriousness of the offender’s conduct and would be inconsistent with the ends of justice.
(b) The court may impose a sentence of conditional discharge for an offense if the court is of the opinion that neither a sentence of imprisonment nor of probation supervision is appropriate.” Ill. Rev. Stat. 1973, ch. 38, par. 1005 — 6—1.
As stated earlier, it is not the function of a reviewing court to reweigh the evidence and substitute its judgment for that of the trial judge on the merits of the question of probation, but rather to determine whether the trial court *483failed to exercise discretion or acted in an arbitrary manner in denying probation. In this case the record shows that at the presentence hearing the trial court considered the probation officer’s report and heard testimony by the defendant, his employer, his father-in-law and one of the State troopers who participated in the arrest and conducted the search of defendant’s car. The State’s Attorney and defense counsel each presented arguments as to the applicability of the various sentencing criteria contained in section 5 — 6—1 of the Unified Code of Corrections set forth above.
In announcing his decision to deny the request for probation, the trial judge commented on the quantity of marijuana possessed by the defendant and the seriousness of the offense. The transcript reflects that the judge not only exercised discretion on the matter of probation but did so after careful thought and deliberation in applying the pertinent criteria. Consequently, we would normally affirm, and would do so here were it not for the fact that in his statement of the reasons for his opposition to probation the State’s Attorney emphasized the quantity of cannabis in defendant’s possession “which is the most serious offense of the Cannabis Control Act. Class 3 felony.” Later in the same statement, after referring to the defendant’s earlier difficulties in the armed forces and the seriousness of the drug abuse problem, the State’s Attorney again stated defendant was “violating the most serious provision of our Cannabis Control Act,” concluding that to grant probation to a defendant who had nearly 650 grams of cannabis seriously impeded efforts of law-enforcement personnel to reduce drug abuse. The comments were not inappropriate except for the references to defendant’s offense as the “most serious offense” under the Act. It is the most serious of the possession offenses, which are graduated according to the quantity of cannabis possessed. (Ill. Rev. Stat., 1972 Supp., ch. 56y2, par. 704.) It is not, however, the most serious offense *484defined in the Act, which also includes offenses in the manufacture or delivery of cannabis (Ill. Rev. Stat., 1972 Supp., ch. 56M>, par. 705) for which the felony classification and punishment may be more serious, and offenses involving delivery of cannabis to younger persons for which the penalty may be substantially more severe (Ill. Rev. Stat., 1972 Supp., ch. 561/2, par. 707). The State’s Attorney undoubtedly intended his reference to mean “the most serious possession offenses.” But that is not what he said. Perhaps, or even probably, they were understood by the judge as they were intended. But we cannot be certain. And because of that lack of certainty, coupled with the fact that the judge clearly considered the question whether probation should be granted a difficult decision and his expressed reason for his decision was the “seriousness of the offense,” we have concluded to remand for such further consideration as the trial judge believes appropriate.
We accordingly affirm that portion of the appellate court judgment affirming defendant’s conviction, reverse that portion of the appellate court judgment which vacated the sentence and remanded the cause to the trial court with directions to grant probation, and remand the cause for the further consideration of the trial judge.
Appellate court affirmed in part and reversed in part and cause remanded.