delivered the opinion of the court:
Dеfendant, Joyce Bush, was charged with two counts of possession of a controlled substance with the intent to deliver (720 ILCS 570/401(d), 407(b)(2) (West 2000)). Following a bench trial, the circuit court of Cook County convicted defendant of both counts and sentenced her to 6V2 years in prison. Defendant raised several arguments on appeal, and the appellate court affirmed. No. 1 — 02— 1187 (unpublished under Supreme Court Rule 23). We allowed defendant’s petition for leave to appeal. 177 Ill. 2d R. 315(a). Before this court, defendant argues that (1) the State failed to prove her intent to deliver, and (2) the State failed to prove that the substance in question was cocaine. For the reasons that follow, we affirm.
BACKGROUND
Officer Todd Olsen of the Chicago police department testified to the following facts. On September 26, 2000, at approximately 1:50 a.m., Officer Olsen was conducting narcotics surveillance on South Ridgeway with his partner, Officer Richard Pruger. On two occasions over the course of approximately five minutes, Officer Olsen observed an unknown male approach defendant, who was standing behind a wrought iron fence that fronted an apartment building. On each occasion, defendant and the man would engage in a brief conversation. Defendant would then accept an unknown amount of money from the man, walk a few feet away, reach under the fence, rеtrieve a small unknown item from a brown paper bag, and deliver the unknown item to the man who had just given her money. After watching the second of these transactions, Officer Olsen was convinced that he was witnessing the sale of narcotics. He and his partner returned to their squad car and pulled up in front of defendant, who was still in position behind the wrought iron fence. While Officer Pruger detained defendant, Officer Olsen retrieved the brown paper bag from underneath the fence. Inside the brown paper bag, Officer Olsen found a Ziploc bag containing a white chunk of what appeared to be crack cocaine. Defendant was placed under arrest, and a custodiаl search revealed two $10 bills in her pants pocket. Officer Olsen inventoried the white substance under number 2419062 and sent it to the Illinois State Police Crime Lab for testing.
Following Officer Olsen’s testimony, the State tendered a stipulation entered into with defendant concerning the white substance recovered from the brown paper bag. That stipulation provided as follows:
“[I]f called to testify, Joel Gray would testify that he’s a forensic scientist employed by the Illinois State Police Crime Lab. That he is an expert in the field of forensic chemistry. That he would testify that he tested the item recovered in this case inventoried under number 2419062 and used tests and procedures commonly — commonly acсepted in the field of forensic chemistry for the testing of narcotics.
Based on his expertise, he would testify that that item was in fact cocaine in the amount of less than .1 gram. Also be a stipulation that that remained intact from the time it was inventoried to the time of testing at the crime lab.”
The trial court accepted the stipulation without objection, and the State rested.
Defendant moved for a directed verdict, and the trial court denied the motion. After hearing closing arguments, the trial court found defendant guilty on both counts. Defendant filed posttrial motions raising several issues, none of which attacked the adequacy of the foundation for Gray’s opinion. The trial court denied defendant’s motions and sentenced her to 6V2 years in prison. The appellate court affirmed (No. 1 — 02—1187 (unpublished under Supreme Court Rule 23)), and we allowed defendant’s petition for leave to appeal (177 Ill. 2d R. 315(a)).
ANALYSIS
Defendant raises two arguments before this court. First, defendant argues that the State failed to prove beyond a reasonable doubt that she intended to deliver the substance recovered from the brown paper bag. Second, defendant argues that the State failed to prove beyond a reasonable doubt that the substance recovered from the brown paper bag was in fact cocaine, as Gray’s opinion on that point lacked an adequate foundation. We address each of these arguments in turn.
Intent to Deliver
Defendant first argues that the State failed to prove her intent to deliver the substance recovered from the brown paper bag. In support, defendant argues that the evidence at trial established only two things: (1) that defendant sold two unidentified items out of the brown paper bag; and (2) that the brown paper bag, when recovered, contained a small amount of a substance later identified as cocaine. Defendant then argues that, because Officers Olsen and Pruger did not arrest the two unidentified purchasers, there is no way of knowing what defendant actually sold them. It is entirely possible, defendant contends, that the two items sold from the bag were innocuous, while the cocaine that remained in the bag was for defendant’s personal use. According to defendant, “the *** failure to detain any alleged buyer left the trial court only to guess or speculate whether Ms. Bush had delivered a controlled substance.”
In support of this argument, defendant relies primarily upon three cases. The first is People v. Cooper,
On appeal, the appellate court held that this evidence was insufficient to sustain a conviction fоr possession of heroin with the intent to deliver. Cooper,
“[T]he State wants this court to assume that the four items that Cooper handed out to the four unknown individuals were heroin. Yet, it is possible that the items which Cooper handed out were innocuous. Because neither of the individuals was stopped, we do not know what Cooper handed to them. If only one of the unknown individuals had been stopped, we would not have to guess, speculate or conjecture on whether the defendant had in fact delivered the subject heroin.” Cooper,337 Ill. App. 3d at 114 .
Taking these two points together, the court “refuse[d] to assume that the untested items, including those allegedly sold to four unknown buyers, were heroin.” Cooper,
The second case relied upon by defendant is People v. Robinson,
Finally, defendant cites this court’s decision in People v. Jones,
In affirming the appellate court’s reversal of defendant’s conviction, this court held that the defendant could be convicted of possessing only 0.59 grams of cocaine with the intent to deliver, as only 0.59 grams оf the recovered substance had been tested and shown to contain cocaine. Jones,
Defendant maintains that Cooper, Robinson, and Jones compel a reversal of her convictions. Defendant first argues that, as in Cooper, none of the factors outlined in Robinson are present in this case. The quantity of drugs recovered from defendant is consistent with personal use, and defendant was not found in the possession of any weapons, large amounts of cash, police scanners, beepers, cellular telephones, or other drug paraphernalia. Defendant then argues that, because none of the Robinson factors are present, “the only basis upon which the court could have determined intent to deliver consisted of the assumption that the unidentified items the officer saw Ms. Bush hand to the two unknown persons contained a controlled substance.” In other words, defendant’s conviction, like Cooper’s conviction, is premised upon the assumption that the items sold out of the bag were identical to the items eventually recovered from the bag. As the Cooper court explained, however, Jones forbids this very assumption. With neither this assumption nor the Robinson factors as its basis, defendant’s conviction for possession with intent to deliver must be reversed.
We reject both defendant’s argument and Cooper. In assessing the sufficiency of the evidence to sustain a verdict on appeal, a reviewing court’s inquiry is “whether, after viewing the evidence in the light most favorable to the prosecution, any rational trier of fact could hаve found the essential elements of the crime beyond a reasonable doubt.” (Emphasis in original.) Jackson v. Virginia,
There is no question that, after viewing the evidence in this case in the light most favorable to the prosecution, a rational trier of fact could have found beyond a reasonable doubt that defendant intended to deliver the substance found in the brown paper bag. Officer Olsen observed defendant standing alone behind a wrought iron fence at 2 a.m. On two separate occasions, an unknown man approached defendant, spoke briefly to her, and handed her money. Defendant then retrieved an unknown item from a brown paper bag that she kept a short distance from herself, handed the item to the man who had just given her money, and returned to her post behind the fence while the unknown man walked away. After detaining defendant, the police looked inside the brown paper bag and found a substance later identified as cocaine. When construed a light most favorable to the prosecution, these facts easily support an inference that defendant intended to deliver thе remaining contents of the brown paper bag.
Neither Robinson nor Jones alters our conclusion. As for Robinson, defendant reads that decision much too narrowly. Defendant mistakenly believes that the list of factors identified in Robinson is both exhaustive and inflexible, and that the absence of such factors precludes a finding of intent to deliver as a matter of law. This is not the case. Robinson makes very clear that the factors enumerated in that opinion are examples of the many factors that “have been considered by Illinois courts as probative of intent to deliver.” Robinson,
The present case perfectly illustrates the wisdom of Robinson’s flexibility. To be sure, defendant is absolutely correct in arguing that none of the factors enumerated in Robinson are present in this case. Nevertheless, there are other factors present that, while not articulated in Robinson, are equally probative of intent to deliver. For example, defendant was standing alone behind a fence at 2 a.m. selling small items from a brown paper bag; defеndant resumed her post behind the fence at the conclusion of both transactions; and when recovered by the police, the brown paper bag contained a substance later identified as cocaine. While defendant may not be the armed, cash-wielding, high-volume drug dealer contemplated in Robinson, the factors outlined above, taken together, are no less indicative of an intent to deliver a controlled substance.
Jones, in turn, has no application to the present case. Again, defendant argues that, because none of the Robinson factors are present, “the only basis upon which the court could have determined intent to delivеr consisted of the assumption that the unidentified items the officer saw Ms. Bush hand to the two unknown persons contained a controlled substance.” We now know, of course, that the absence of “Robinson factors” is of no consequence, as the factors present in this case are equally indicative of an intent to deliver. But even if that were not the case, defendant’s invocation of Jones remains specious. Jones stands for the proposition that, under certain circumstances, the nature of an untested substance cannot be inferred from the nature of a tested substance. In this case, the nature of an untested substance is not at issue. We know that the substanсe found in the brown paper bag tested positive for cocaine, and whether the first two transactions likewise involved cocaine is not dispositive of defendant’s intent to deliver the substance found in the bag. To illustrate, assume that we knew with scientific certainty that the first two transactions did involve cocaine. We still could not infer, from this fact alone, that defendant intended to sell the cocaine found in the bag. As defendant suggests, the remaining cocaine could have been for defendant’s personal use. Conversely, knowing that the first two transactions involved Bazooka bubble gum would not, by itself, preclude the inference that defendant intended to also sell the coсaine. It could be that defendant was selling whatever she could to raise quick cash, be it bubble gum or cocaine.
That said, proof of defendant’s intent to deliver the remaining cocaine is hardly lacking. Officer Olsen testified that, after twice selling small items out of the brown paper bag, defendant once again assumed her post behind the wrought iron fence. This fact alone supports the inference that defendant intended to engage in further transactions. And given that the brown paper bag contained only cocaine, there is only one thing that defendant could have intended to sell. Significantly, this inference has everything to do with defendant’s behavior, and nothing at all to do with the nature of the two items defendant actually sold. Jones is therefore irrelevant.
In sum, this case presents nothing more than a routine sufficiency of the evidence question governed by the familiar standard set forth in Jackson and Collins. The trial court was permitted to draw all reasonable inferences from the evidence in this case, including that defendant intended to sell the remaining contents of the brown paper bag. Nothing in either Jones or Robinson precludes such an inference, and we consequently have no basis for reversing defendant’s conviction on this point.
Stipulated Testimony
Defendant next argues that the State failed to prove her guilty beyond a reasonable doubt because it failed to lay an adequate foundation for Gray’s opinion that the recovered substance was cocaine. More specifically, defendant argues that the State failed to present any proof that (1) the testing equipment used was properly functioning, (2) the testing data was accurately recorded and interpreted, or (3) Gray reached his opinion with a reasonable degree of scientific certainty. Absent such proof, defendant argues, there is no basis for concluding that Gray’s opinion is in any way reliable. Although defendant concedes that she did not raise this argument in the trial court, she insists that it is not subject to waiver because it attacks the sufficiency of the evidence rather than the admissibility of Gray’s opinion. In support, defendant cites People v. Raney,
In Raney, the defendant was charged with possession of a controlled substance with the intent to deliver. At trial, the State called Webelene Bethea, a forensic scientist at the Illinois State Crime Laboratory. The defendant objected to Bethea’s qualification as an expert both because she was not a member of any forensic chemistry organization and because she lacked a degree in chemistry. Over the defendant’s objection, the trial court allowed Bethea to testify. Bethea testified that she tested the substance in question with both a cobalt thiocyanate color test and a gas chromatography mass spectrometer (GCMS) machine. Based on such testing, she concluded that the substance in question contained cocaine. When the State rested, defendant moved for a directed finding based on the State’s failure to prove an adequate foundation for Bethea’s opinion. The motion was denied, and defendant rested. During closing arguments, the defendant again argued that the State failed to lay an adequate foundation for Bethea’s opinion. The trial court found the defendant guilty, and the defendant appealed. Raney,
The appellate court reversed, holding that the State had failed to lay a proper foundation for Bethea’s opinion. In so doing, the court explained that, in People v. Bynum,
“Expert Bethea failed to testify that before conducting the GCMS test of the suspected controlled substance the GCMS machine was working properly. She failed to indicate whether, for example, any testing was done to assess the operating condition of the GCMS machine. She also failed to indicate whether standards were run to test the accuracy of the GCMS machine. As a result, this record contains no evidence regarding whether the GCMS machine was functioning properly at the time it was used to analyze the substance in this case.” Raney,324 Ill. App. 3d at 709 .
In other words, Bethea “failed to explain how the machine was calibrated or why she knew the results were accurate.” Raney,
In Hagberg, the defendant was convicted of possessing a controlled substance. At trial, the only evidence concerning the nature of the substance was the testimony of the arresting officer, who performed a field test on the substance following defendant’s arrest. Although the field test purportedly revealed the presence of cocaine, the arresting officer could not recall the name of the tеst, the instructions for performing the test, the color that indicated that the tested substance contained cocaine, or the color that the test actually turned. Instead, the officer merely asserted that the substance somehow turned the right color, whatever that color might be. This court reversed defendant’s conviction, stating that, “[standing alone, such vague and speculative testimony is by no means sufficient to support defendant’s conviction.” Hagberg,
According to defendant, Raney and Hagberg establish that, “where the charge against a defendant requires proof of the chemical identity of controlled substance, evidence that an expert reached her opinion about the identity of the substance in a reliable manner does not constitute a mere formality that is waived if the omission is not objected to at trial.” Rather, “such evidence provides the only basis upon which a fact-finder may determine the reliability of the opinion, and therefore the sufficiency of the State’s proof.” In other words, as defendant sees it, an argument that an expert’s opinion lacked an adequate foundation cannot be waived because, under both Raney and Hagberg, such an argument ultimately goes to the sufficiency of the evidence.
We disagree. To preserve an issue for review, a defendant must raise an objection both at trial and in a written posttrial motion. People v. Enoch,
In this context, the impact of defendant’s stipulation cannot be overstated. No one disputes that the admission of an expert’s testimony requires an adequate foundation establishing that the information upon which the expert bases his opinion is reliable. See, e.g., Martin v. Sally,
On this point, it is worth noting that this court has previously held that, by failing to object at trial, a defendant waives any argument that an expert’s opinion lacked an adequate foundation. In People v. Jones,
Similarly, in People v. Richardson,
People v. Jones,
Thus, Jones, Richardson, and Jones clearly establish that, by failing to object at trial, a defendant waives any argument that an expert’s opinion lacked an adequate foundation. And in at least one of these cases, the defendant specifically argued that the alleged lack of foundation rendered the State’s evidence insufficient to convict. See Jones,
Jones, Richardson, and Jones also reveal why defendant’s reliance upon Raney is wholly misplaced. In Raney, the defendant repeatedly argued before the trial court that the expert’s opinion lacked an adequate foundation. The defendant in that case objected to the admission of that opinion based upon the expert’s lack of qualifications, moved for a directed verdict based uрon the lack of foundation for the expert’s opinion, and based his closing argument on the lack of foundation for the expert’s opinion. This is in stark contrast to Jones, Richardson, and Jones, where the defendants allowed the expert’s opinion to be admitted without any objection. More importantly, Raney is in stark contrast to the present case, where defendant not only allowed Gray’s opinion to be admitted without objection but also invited its admission by agreeing to the stipulation.
As importantly, Raney itself acknowledges that, by failing to object at trial, a defendant waives any argument an expert’s opinion lacked an adequate foundation. Again, Raney reliеd principally upon People v. Bynum,
As for Hagberg, defendant reads far too much into that opinion. As characterized in defendant’s brief, Hag-berg stands for the proposition that “[a]n expert’s bald opinion, without evidence of its reliability, cannot constitute proof of guilt beyond a reasonable doubt.” In fact, Hagberg stands for no such thing. In Hagberg, the opinion in question was not rendered by an expert. Rather, it was rendered by someone who the defense, through its cross-examination, very ably demonstrated had no expertise whatsoever in the relevant field. Thus, properly characterized, Hagberg stands for the proposition that the opinion of someone who has no idea what he is talking about cannot constitute proof of guilt beyond a reasonable doubt. This principle, of course, has no application to the present case, where the opinion in question was admitted by stipulation and rendered by someone defendant concedes is an expert in the field of forensic chemistry.
In reaching this result, we also reject defendant’s argument that the waiver rule should be suspended in this case because the admission of Gray’s opinion in the absence of an adequate foundation amounted to plain error. As discussed above, by stipulating to the admissibility of Gray’s opinion, defendant waived the necessity of proving the requisite foundation for that opinion. The trial court’s admission of that opinion was therefore not only not plain error, it was not error at all.
CONCLUSION
The evidence in this case was more than sufficient to support an inference that defendant intended to deliver the substance recovered from the brown paper bag. Defendant’s argument that Gray’s opinion lacked an adequate foundation is waived. For these reasons, we affirm the judgment of the appellate court, affirming defendant’s convictions for possession of a controlled substance with the intent to deliver.
Affirmed.
