Defendant Michael Mitchell was charged by bill of information dated October 31, 1990 with possession of cocaine, a violation of LSA-R.S. 40:967. He waived his right to a jury and was tried before a judge on April 23, 1991. Defendant was found guilty as charged. He was subsequently sentenced to three years at hard labor. On the same day, the State filed a multiple offender bill of information. Defendant admitted the allegations in the bill and was re-sentenced as a second felony offender to three years at hard labor. He now appeals.
Officers Daniel Scanlon and Kenneth Watzke testified that while patrolling the area of Seventh and Dryades Streets in New Orleans on October 10, 1990, they observed the defendant apparently engaged in a drug transaction. Both officers testified that they observed defendant and a second subject standing near the corner of Seventh and Dryades Streets near a red parked vehicle. The second subject was looking into defendant’s cupped hands at some small objects. When the two subjects noticed the officers, they split up. The second subject ran into a nearby bar and defendant went to the red parked vehicle and threw an object into the open passenger door. The officers pulled in behind the red car, got out of their vehicle and ordered defendant to put his hands on the trunk of the red car for a protective pat down. The officers advised defendant he was under investigation for a possible narcotics violation. The officers testified that there was a second police vehicle behind them, that the two officers in that vehicle pursued the second subject into the bar but were unable to locate him.
Officer Watzke further testified that he looked into the red vehicle and saw on the front passenger’s seat, in plain view, a crumpled white napkin and fifteen individually wrapped plastic packets of a white rock-like substance he believed to be cocaine. Watzke stated he informed Scanlon of his findings, at which point Scanlon placed defendant under arrest, handcuffed him and advised him of his rights.
The napkin and fifteen packets of rock-like substance were admitted into evidence. The chain of custody was established through the testimony of Officer Scanlon.
By stipulation, Alan Sisón, a criminalist with the New Orleans Police Department, was qualified as an expert in the testing and analysis of controlled dangerous substances. Sisón testified that he tested and analyzed samples of the rock-like substance seized and found they contained cocaine.
The defendant presented two witnesses, Omar Scott and Clarence Anderson, who contradicted the testimony of the officers. Scott testified as follows: On October 10, 1990, at approximately 12:20 a.m., he was standing outside a bar on the corner of Dryades and Seventh Streets waiting for Michael Mitchell. When Mitchell exited the bar, the two men proceeded to Mitchell’s car, a black Riviera. They were immediately stopped by two police officers who told them to place their hand on the rear of the car. The officers went into the car then informed Mitchell and Scott that cocaine had been found in the car. They arrested Mitchell and Scott and put them in separate cars. When the officers realized Scott was a juvenile, they let him go because his arrest would involve too much paperwork.
When the judge asked Scott why he was out so late on a school night, Scott explained that he was out buying seafood. He stated defendant walked out of the bar with a bag of crabs which he threw when the police approached him. Scott further testified that he had known defendant seventeen years, all of his life.
Clarence Anderson testified as follows: He was standing on the corner of Dryades and Seventh Streets on the night in question when Mitchell and “his little fellow” exited the bar and proceeded to Mitchell’s car, a black Riviera. They were stopped by police officers who made the two men put their hands on the rear of the black Riviera. The officers then went into the car, searched the area then handcuffed Mitchell and Scott. The two subjects were placed into two different cars.
*1273On rebuttal, Officer Scanlon testified that he did not recall seeing Omar Scott on the night in question; he did not arrest Scott that night; the paperwork involved in arresting a juvenile is the same as involved in arresting an adult except that an additional face sheet is required; and he had previously arrested Scott in 1988, at which time he (Scanlon) completed the necessary paperwork.
ERRORS PATENT:
A review of the record for errors patent reveals there are none.
ASSIGNMENTS OF ERROR:
Defendant argues that the trial judge’s questioning of defense witness Omar Scott substantially prejudiced his rights.
A trial judge may examine a witness in order to bring out needed facts not elicited by the parties. State v. Burrell, 561 So.2d 692 (La.1990); State v. Gilmore, 529 So.2d 859 (La.App. 4th Cir.1988).
The record reveals that the judge’s examination of defense witness Omar Scott, after direct examination, cross-examination and re-direct, was purely for the purpose of clarification.
The judge asked Scott if he had seen the officers take the drugs out of the car, which neither party had asked. Scott answered “yes”, then “no”. The question was repeated four times because Scott kept contradicting himself. Scott finally stated that he had in fact seen the officers go into the car and retrieve drugs.
The judge then attempted to clarify the witness’ testimony as to whether the subjects were arrested prior or subsequent to the confiscation of drugs. The judge also asked Scott whether the officers informed them why they were required to put their hands on the car to which Scott responded “no”; whether Mitchell had a car to which Scott responded “no”; how Scott arrived at the bar; and what Scott, a juvenile, was doing out on a school night at one a.m.
The judge’s questioning of Scott was an attempt to bring out facts not elicited by the parties. The judge was clearly acting within his discretion. Further, the cases relied upon by defendant and cited herein involved jury trials and warn that a judge must be cautious in his questioning of a witness so as not to impliedly comment on the evidence in violation of C.Cr.P. art. 772. The defendant in this case was tried only before the judge, having waived his right to a jury. Defendant does not allege that the trial judge was biased against him or that the judge had abandoned his role as a neutral arbiter. This assignment of error is without merit.
Defendant also claims that the evidence is insufficient to support the conviction. When assessing the sufficiency of evidence to support a conviction, the appellate court must determine whether, viewing the evidence in the light most favorable to the prosecution, any rational trier of fact could have found proof beyond a reasonable doubt of each of the essential elements of the crime charged. Jackson v. Virginia, 443 U.S. 307, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979); State v. Jacobs, 504 So.2d 817 (La.1987).
In order to convict the defendant in the present matter, the State had to prove beyond a reasonable doubt that defendant knowingly and intentionally possessed cocaine. R.S. 40:967(C).
Officers Scanlon and Watzke both testified that they observed defendant in what appeared to be a drug transaction. They testified that upon seeing the officers the second subject ran into a nearby bar and the defendant threw an object into the open door of a red vehicle parked nearby. Officer Watzke further testified that he looked into the parked vehicle and saw in plain view a crumpled white napkin and fifteen packets of a rock-like substance, and that substance later tested positive for cocaine.
The cocaine was properly admitted into evidence; the chain of custody was established; and a qualified expert testified that the substance was in fact cocaine.
Defendant argues that the evidence is insufficient based on the testimony of defense witnesses, which contradicted that of the officers. The function of the appellate court is not to assess the credibility of the *1274witnesses or reweigh the evidence. State v. Rosiere, 488 So.2d 965, 968 (La.1986).
Viewing the evidence in the light most favorable to the prosecution, a rational trier of fact could have concluded beyond a reasonable doubt that defendant knowingly and intentionally possessed cocaine.
' This assignment of error is without merit.
For the reasons assigned defendant’s conviction and sentence are hereby affirmed.
AFFIRMED.