delivered the opinion of the court.
In a five-count indictment, defendant was charged with two armed robberies, two aggravated batteries and an attempt to murder. He waived trial by jury. The court found him guilty and imposed concurrent terms of six to ten years on one count of armed robbery and one count of aggravated battery.
Defendant appeals, contending that (1), the trial court erred in denying his motion to suppress identification evidence; (2), his waiver of trial by jury was not knowingly and understandingly made; (3), the pretrial identification procedure used by the police was unnecessarily suggestive and so conducive to irreparable mistaken identification that defendant was denied due process of law; (4), the trial judge committed prejudicial error admitting in evidence a gun without proof connecting it with the defendant; and (5), he was not proven guilty beyond a reasonable doubt.
On July 19, 1967, at about 11:00 a. m., Gloria Stewart was working as a barmaid in a tavern at 1018 North Wells Street, Chicago. Two men entered. A short time later, Jeff Wright, a regular patron of the tavern came in. He went to his favorite booth but found it occupied by a man whom, at the trial, Wright identified as the defendant. Not being able to sit in his usual spot, Wright sat at the bar, his back to the booth. Neither Gloria Stewart nor Jeff Wright had ever seen the man before. This man remained in the tavern for about half an hour, his companion having left earlier.
While Wright was seated at the bar, he saw the man in the booth drop a gun to the floor. The man picked *150up the gun. Gloria Stewart, who also saw the incident, left the bar to go call the police. As she did, the man took the gun, held it on Miss Stewart and told her to get back behind the bar. He gave similar orders to Jeff Wright. He forced Gloria Stewart and Jeff Wright to their hands and knees. Gloria Stewart was ordered to open the cash register and the man took the money that was in it. He then struck Jeff Wright with the gun. As Wright pulled at the man’s legs, the man shot him in the face, just below the right eye. The man then took a pint of whiskey off the shelf and left the tavern. The police were called. Jeff Wright was taken to a hospital. Either that day or the next, Gloria Stewart picked out a picture of the defendant from a number shown to her by the police. On October 17, 1967, defendant was arrested and the five-count indictment was returned against him.
Prior to trial, defendant moved to suppress the State’s identification evidence. When the motion was heard, Detective Vincent Sandore, the officer who investigated the robbery, and Jeff Wright were in court. Defendant called them as witnesses in support of his motion. Their testimony disclosed that one hour before the hearing, Sandore showed Wright two photographs, both of the same person, the defendant. In addition, Wright testified that on December 1, 1967, after Detective Sandore told him “that he had the man” who committed the robbery, he identified defendant in the felony court.
After Sandore and Wright testified, defendant’s counsel inquired if Gloria Stewart was in the courtroom. He was told she was not. Counsel then told the court that he had expected Miss Stewart to be present and be called as a witness. He requested that hearing of defendant’s motion be continued to the next day. The request was denied. The trial judge then said that he was denying the motion to suppress with leave to renew it if evidence at trial warranted its reconsideration.
Defendant contends this was error. He argues that Sandore’s showing of the two photographs to Wright was an attempt to condition the witness so he could make an identification. Defendant argues that the incident concerning the photographs, combined with the *151confrontation in the court, was suggestive and conducive to irreparable mistaken identification.
This argument assumes that the in-court identification by Jeff Wright was based on the two occurrences about which complaint is made. The record, however, shows that when Wright testified, he was asked how long and how close the man he identified as the defendant was in his presence in the tavern on July 19, 1967 when the robbery was committed. Wright’s answer was “[a]bout 15, 20 minutes, maybe longer. ... I would say about five feet, three stools from me.” At the time the robbery was committed and he was shot, Wright said he was close enough to his assailant to touch him. He never wavered from this testimony.
These questions were asked Wright in order to establish that his in-court identification of the defendant was based on observations of the suspect other than the felony court appearance and the showing of the photographs by Sandore. See United States v. Wade, 388 US 218, 242, 18 L Ed2d 1149, 87 S Ct 1926 (1967). We think it undeniable that Wright’s viewing of defendant in the felony court after being told that the police had the man who committed the robbery, and his being shown the two photographs by Sandore, were unnecessarily suggestive. Compare People v. Rahming, 26 NY2d 411, 259 NE2d 727 (1970); United States v. Zeiler, 427 F2d 1305 (3rd Cir 1970), 38 LW 2663.
These conclusions, however, do not dispose of the contention before us. The test which applies to situations like this one, granting there was an unfair or unconstitutional pretrial identification procedure, is one that will determine whether the in-court identification of defendant was induced by the tainted procedure or had a prior independent origin. See Wong Sun v. United States, 371 US 471, 9 L Ed2d 441, 83 S Ct 407 (1963). Application of this test requires consideration of what prior opportunity Jeff Wright had to observe defendant at the time of the alleged criminal acts. People v. Taylor, 123 Ill App2d 430, 258 NE2d 823.
Consistent with these principles, we have held that where an unfair pretrial identification procedure is shown, the subsequent in-court identification may never*152theless be admissible if the prosecution shows that the in-court identification had a prior independent origin, arising from other uninfluenced observation of the person later identified as the defendant. People v. McMath, 104 Ill App2d 302, 244 NE2d 330, affirmed 45 Ill2d 33, 256 NE2d 835; People v. Cook, 113 Ill App2d 231, 252 NE2d 29. By these standards, the unshaken testimony of Jeff Wright established a prior independent source for his in-court identification of the defendant. People v. Gates, 123 Ill App2d 50, 259 NE2d 631. Therefore, it was not error for the trial court to overrule the motion to suppress.
The next contention concerns defendant’s waiver of trial by jury. The record discloses a colloquy, in Chambers, while a jury panel was waiting in the courtroom.
THE COURT: “. . . Mr. Lenair, do you wish to be tried by this Court or by a jury?”
THE DEFENDANT: “This Court.”
THE COURT: “You know your constitutional rights, you have a right to be tried by a jury, you understand that?”
THE DEFENDANT: “Yes, Sir.”
THE COURT: “You have a right to be tried by a jury.”
THE DEFENDANT: “Yes.”
THE COURT: “You wish to be tried by this Court, rather than a jury, is that correct?”
THE DEFENDANT: “Yes, sir.”
THE COURT: “Sign the jury waiver then.”
The defendant signed the jury waiver. The panel was returned to the jury room. On these facts, defendant argues it was error for the trial judge to accept his jury waiver without eliciting from him an acknowledgment that he knew and understood the nature of a jury trial.
There is no precise formula for determining whether waiver of trial by jury is under standingly made by a defendant. People v. Richardson, 32 Ill2d 497, 499, 207 NE2d 453. Whether there is an understanding jury waiver depends on the facts and circumstances of each case. People v. Spencer, 115 Ill App2d 398, 253 *153NE2d 672. Defendant was furnished counsel well in advance of trial. Compare People v. Baker, 126 Ill App2d 1, 262 NE2d 7. When asked by the trial judge whether he wished to be tried by the court rather than by a jury, defendant answered, “Yes, sir.” When he was instructed to sign the jury waiver, he manifested understanding and did so. We conclude that defendant knowingly and understandingly waived his right to trial by jury. People v. Steenbergen, 31 Ill2d 615, 203 NE2d 404.
In presenting its case, the State called Gloria Stewart. Without objection, she identified defendant as the man who entered the tavern on July 19, 1967, remained there “about a half an hour,” committed the robbery and shot Jeff Wright. She said she served the defendant beer; and in distance feet, she was as close to him as “ [m] aybe three, maybe not that far.” At the time of the robbery, Miss Stewart said she was as near to the defendant as two feet. She described the defendant as having hair “. . . in a process . . . his goatee . . . under here, on his chin ... he was wearing a hat and a beige looking sweater or shirt.” When the police came, she gave them a description of the man she later said was the defendant. A report of this description was made and a copy of it was furnished defendant at the trial. James Marchetti, the officer who arrested the defendant, testified that when he took defendant into custody, “he had a process hair and a goatee.”
Miss Stewart testified that either the day of the robbery or the next day she went to a police station where she was shown some pictures and she picked out one, that of the defendant. The following day a police officer came to her place of employment, showed her some more pictures and told her to be sure “. . . that I know what I’m saying, be sure that I know the face, that I get it right.” She again picked out a photograph, that of the same man; it was a picture of the defendant. When she was examined further, Miss Stewart testified that on December 1, 1967 she and Jeff Wright were present in the felony court. She said that before the hearing, either a police officer or an assistant state’s attorney told her that the police had caught the man who com*154mitted the robbery. When defendant was brought before the preliminary examining judge, she identified him.
Defendant contends that identification of him in the felony court by Gloria Stewart and Jeff Wright "was conducted in a manner which was highly suggestive and grossly unfair, lending to great risk of error.” This is a reiteration of defendant’s contention concerning the motion to suppress. Its disposition is governed by the same principles of law. The testimonies of Gloria Stewart and Jeff Wright, despite unfairness of the pretrial identification procedure, established that their courtroom identifications had an independent origin, arising from an earlier uninfluenced observation of the defendant. See People v. Blumenshine, 42 Ill2d 508, 250 NE2d 152; People v. McMath, supra; People v. Cook, supra. Therefore, the in-court identifications were properly admitted. People v. Moore, 104 Ill App2d 343, 244 NE2d 337.
Defendant’s fourth contention involves People’s Exhibit 1, the gun which the prosecution claims was used in the robbery of the tavern and the shooting of Jeff Wright on July 19,1967. Although defendant strenuously argues that the State’s evidence did not connect him with the gun, when it was proffered, the trial judge asked if there was any defense objection to its admission. Defendant’s counsel replied: "No objection, Your Honor.” Having failed to object, defendant cannot now urge that it was error to admit the gun in evidence. People v. Trefonas, 9 Ill2d 92, 136 NE2d 817; People v. Luckett, 24 Ill2d 550, 182 NE2d 696; People v. McNeil, 99 Ill App2d 273, 240 NE2d 721.
Finally, defendant contends that he was not proven guilty beyond a reasonable doubt. In support of this contention defendant points to his testimony that on June 25, 1967, he left Chicago and went to Lula, Mississippi where he visited his sister, Evalina Turner. He swore that it was not until between the 12th and 14th of August of that year that he returned.
Acceptance of this argument requires rejection of the State’s rebuttal by the testimony of Eddie Wil*155liams, Agnes Brock and Glovenia Orr who in varying degrees, contradicted defendant’s testimony. The testimony of these witnesses, together with that of Wright and Miss Stewart, and defendant’s which purported to establish an alibi, had to be weighed by the trial judge in determining credibility. The trial judge was not obliged to believe the defendant or his alibi evidence over the positive identification testimony of the two complaining witnesses. People v. Setzke, 22 Ill2d 582, 177 NE2d 168; People v. Pierre, 114 Ill App2d 283, 252 NE2d 706. We note that after defendant testified, the State, in rebuttal, introduced evidence on the issue of defendant’s credibility. This evidence consisted of a record showing that in 1961 defendant had been sentenced to a term of two to five years for robbery while armed with a gun.
As we have said many times, in a case tried without a jury, it is the function of the trial judge to determine the credibility of the witnesses and the weight to be given their testimony. People v. Parker, 120 Ill App2d 71, 256 NE2d 67; People v. Jackson, 95 Ill App2d 28, 237 NE2d 858. We will not substitute our judgment on credibility for that of the trial judge unless the evidence is so improbable or unsatisfactory as to raise a reasonable doubt of defendant’s guilt. People v. Hoffman, 45 Ill2d 221, 226, 258 NE2d 326; People v. Hampton, 44 Ill2d 41, 45, 253 NE2d 385. After reviewing the record, we conclude that the evidence supports the conviction. Judgment is affirmed.
DRUCKER and ENGLISH, JJ., concur.