delivered the opinion of the court:
Defendant, James Murphy, was indicted in Lake County for rape and indecent liberties with a child (Ill. *426Rev. Stat. 1973, ch. 38, pars. 11 — 1, 11 — 4). His first trial ended in a mistrial when the jury was unable to reach a verdict. At his second jury trial before the same judge, defendant was found guilty of indecent liberties only and was sentenced to 12 to 70 years’ imprisonment. The appellate court affirmed. (47 Ill. App. 3d 278.) We granted defendant’s petition for leave to appeal under Rule 315 (65 Ill. 2d R. 315).
Three issues are raised. First, whether the facts raised a bona fide doubt of defendant’s fitness for trial requiring the trial judge to hold a fitness hearing sua sponte under section 5 — 2—1 of the Unified Code of Corrections (Ill. Rev. Stat. 1973, ch. 38, par. 1005 — 2—1). Second, whether defendant received competent assistance of privately retained counsel. Third, whether the sentence was excessive.
Defendant was charged with sexually molesting a 6-year-old girl on August 31, 1974. He was arrested on September 9, 1974.
Prior to the first trial, the prosecution requested a pretrial psychiatric examination of defendant (Ill. Rev. Stat. 1973, ch. 23, par. 2402), since he was charged with indecent liberties with a child. (Subsequent to these proceedings, this court held in People v. Pierce (1976), 62 Ill. 2d 223, 225, and the statute was amended to provide (Ill. Rev. Stat. 1977, ch. 23, par. 2402), that such an examination need be given only at the request of the defendant.) The trial court ordered an examination, limited to a determination of whether defendant was suffering from mental disease. After discussion with counsel for defendant, the trial court indicated the question of fitness for trial was not raised. Counsel stated that defendant understood the nature of the proceedings against him.
The psychiatric report by Dr. Ronald Baron concluded that defendant is “fairly severely mentally retarded” but “able to understand simple procedures but not *427complicated ones or those having abstract meanings.” Defendant denied the crime but appeared evasive when he did so, giving the psychiatrist the impression defendant was lying. Defendant knew his attorney’s name and knew the crime with which he had been charged.
Dr. Edward Leslie, a psychiatrist, found defendant to be of dull-normal intelligence in an interview situation. Defendant was not particularly direct in his answers. He was aware of the charges against him and denied his guilt. He was able to read and understand a Miranda rights statement (Miranda v. Arizona (1966), 384 U.S. 436, 16 L. Ed. 2d 694, 86 S. Ct. 1602). He was aware of the help he could receive from an attorney. The doctor further concluded that defendant was fit to stand trial.
Preceding the first trial, defense counsel moved on several grounds to suppress confessions defendant had made to the police. Included was the ground that defendant’s limited intellectual capacity precluded him from reading and understanding the alleged statements. The motion was renewed prior to the second trial. In support of the motion, defense counsel filed an affidavit by defendant’s sister attesting that defendant is of limited intellectual capacity and could not have comprehended the statements bearing his signature; that he is illiterate and cannot read on any level above a first grade “cat” and “dog” vocabulary; that his last few years of education, until the compulsory age to leave school, were spent in special education classes for the retarded. His sister believed defendant could not have known what the statements purported to contain.
At the hearing on the motion, the State’s evidence was that defendant voluntarily came to the police station with Patrolman Hansen, a uniformed officer, who had been informed of defendant’s presence in the area of the ravine where the molestation had taken place. On the way to the station in the squad car, defendant was told his Miranda *428rights and he said he understood them. No questioning followed.
At the station, Patrolman House testified he told defendant the police were investigating a rape. According to the officer, defendant said he had seen nothing, but, when asked again, hesitantly replied he saw a 14-year-old Mexican boy rape a little Mexican girl. Defendant acted uneasy and smiled. The patrolman questioned the defendant whether he was telling the truth and asked whether defendant had molested a little girl. Defendant said he did not understand the word “molested.” The officer then asked if defendant had taken the little girl’s pants down and “screwed” her. Defendant answered, “Yeah.”
The investigation was continued by Detective Niemietz, who repeated the Miranda warnings. Defendant said he understood each one as it was read to him. Defendant read and signed a waiver form. Defendant then described how he molested a little girl, and he identified her from a photograph. The officer prepared a typed statement and read it to defendant. Defendant appeared to read it to himself and then signed the statement. Defendant was then charged with rape and indecent liberties with a child.
The next morning defendant was again given his Miranda warnings, and he said he understood them. He again signed a waiver of rights form and agreed to questioning. He admitted and recounted his molestation of the girl.
During the course of the investigation, defendant indicated to the officers he did not understand the words “penetrate,” “molest,” “psychiatrist,” and “Miranda.” According to the officers, he appeared to understand those words when they were translated into the vernacular. The word “attorney” was also defined for him, as well as parts of the male and female anatomy. One officer testified defendant’s responses were slow but that he understood.
*429At the close of the testimony on the motion to suppress, the trial court concluded defendant intelligently and knowingly waived his Miranda rights and that he did not lack the intellectual capacity to give a statement knowingly.
Prior to the second trial on February 10, 1975, defendant renewed the motion to suppress on the grounds that he could not have knowingly waived his constitutional rights under Miranda. The trial court again denied the motion. At trial the police officers substantially repeated the testimony they had given at the hearing on the motion to suppress.
Defendant testified on his own behalf. He was questioned about his understanding of sexual terminology. Defendant’s counsel began to ask questions concerning defendant’s understanding of a lawyer’s function. Defendant knew what an attorney was and knew that counsel was representing him. The court halted this line of questioning and inquired of counsel whether she was seeking a determination of defendant’s fitness for trial. Counsel responded:
“I have fortunately two psychiatric reports very recent that he is competent to confer with counsel and to stand trial, and they are both dated late December.”
The court indicated it was relying on counsel to raise the fitness question if she had any doubt of defendant’s fitness. Defendant then read from his signed statement out loud in court. He said he could read it all.
A school psychologist testified on defendant’s behalf. He had examined defendant in 1969 when defendant was 14% years old. He had administered intelligence tests and determined defendant fell into the category of the educable mentally handicapped (EMH). This meant defendant learned more slowly than normal but could pursue academic studies. His 10 ranged from 37 to 60. Normal is 100. He could not testify as to defendant’s *430current mental development, although he said it would not be correct to assume defendant had made no progress.
Dr. Leslie testified on rebuttal that defendant answered directly, relevantly and coherently when asked about positive matters. He answered questions he thought harmful to him evasively, unrealistically, softly, and circuitously. Defendant was able to read.
Defendant first contends that he was denied due process of law when no hearing was held to determine his fitness to stand trial. We disagree.
It is established that the conviction of a person who is unfit to stand trial violates due process. (Pate v. Robinson (1966), 383 U.S. 375, 378, 15 L. Ed. 2d 815, 818, 86 S. Ct. 836, 838;People v. Barkan (1970), 45 Ill. 2d 261, 263; People v. Burson (1957), 11 Ill. 2d 360, 368.) And the failure to observe procedures adequate to protect a defendant’s right not to be tried while unfit deprives him of his due process right to a fair trial. Drope v. Missouri (1975), 420 U.S. 162, 172, 43 L. Ed. 2d 103, 113, 95 S. Ct. 896, 904; Pate v. Robinson (1966), 383 U.S. 375, 15 L. Ed. 2d 815, 86 S. Ct. 836.
In the instant case neither the defendant nor the State made a request for a fitness hearing. But because of the fundamental constitutional nature of the fitness requirement, once facts are brought to the attention of the trial court, either from observation of the defendant or by suggestion of counsel, which raise a bona fide doubt of defendant’s fitness to stand trial, the court has a duty to hold a fitness hearing. People v. Harper (1964), 31 Ill. 2d 51, 56; People v. Slaughter (1970), 46 Ill. 2d 114, 119; People v. Burson (1957), 11 Ill. 2d 360, 368-69.
The Unified Code of Corrections expressly provides for this:
“(b) *** [T] he question of fitness may be raised by the State, the defendant or the court.
(c) When a bona fide doubt of the defendant’s *431fitness to stand trial or be sentenced is raised, the court shall order that a determination of that question be made before further proceedings.” Ill. Rev. Stat. 1973, ch. 38, pars. 1005 — 2—1(b), (c).
Fitness for trial consists of two qualities enumerated in the Unified Code of Corrections: the ability to understand the nature and purpose of the proceedings and the ability to assist in one’s defense. (Ill. Rev. Stat. 1973, ch. 38, par. 1005 — 2—1(a); People v. Foley (1963), 28 Ill. 2d 426, 427; cf. Dusky v. United States (1960), 362 U.S. 402, 4 L. Ed. 2d 824, 80 S. Ct. 788, setting forth similar criteria for Federal cases.) The critical inquiry is thus whether the facts presented a bona fide doubt that defendant possessed the two qualities necessary to make him fit for trial.
Whether a bona fide doubt has been raised is a decision resting largely within the discretion of the trial court. (People v. Skorusa (1973), 55 Ill. 2d 577, 582; People v. Southwood (1971), 49 Ill. 2d 228, 230; People v. Franklin (1971), 48 Ill. 2d 254, 258; People v. Dudley (1970), 46 Ill. 2d 305, 309-10.) In resolving this issue we bear in mind that the trial court, unlike the reviewing courts, was in a position to observe the defendant and evaluate his conduct. People v. Dudley (1970), 46 Ill. 2d 305, 310; People v. Foley (1963), 28 Ill. 2d 426, 428; People v. Cleggett (1961), 22 Ill. 2d 471, 474.
Defendant testified on his own behalf. His responses were inarticulate, but he appeared to understand what he was being questioned about. He cooperated with counsel in answering questions to indicate his confessions were not voluntary and otherwise denied his guilt. He testified the police threatened him to compel him to sign the confessions and that he was arrested by mistake. It appeared that he evaded answering questions seemingly damaging to him.
The court heard evidence by police officers who investigated defendant. Defendant told them he under*432stood his Miranda rights. Words he indicated he did not understand were defined in simple terms, and he appeared to understand them upon explanation. His demeanor indicated he understood what he was being questioned about.
Psychological reports and testimony indicated defendant was retarded. He was, however, an educable mentally handicapped person who could understand and reason, although more slowly than average. He finished two years of high school, apparently in special classes. Although the psychiatric reports were not ordered to determine defendant’s fitness for trial, they addressed relevant questions. The psychiatric reports indicated defendant knew his attorney’s name. He knew about the crime with which he was charged and denied his guilt. Defendant gave one psychiatrist the impression he was lying when he denied the crime. The other concluded defendant was fit to stand trial. At trial psychiatric testimony indicated defendant avoided answering questions he thought unfavorable to him; defendant’s evasive testimony was thus purposive and negated doubt of his fitness to stand trial.
The trial court received assurances by defense counsel that in her opinion and as a result of psychiatric reports there was no doubt of defendant’s fitness for trial. She said defendant understood, was competent to confer with counsel, and could stand trial.
Counsel’s suggestion that defendant had limited mental capacity is not sufficient of itself to raise a bona fide doubt of defendant’s fitness for trial. (People v. Harper (1964), 31 Ill. 2d 51, 56; People v. Foley (1963), 28 Ill. 2d 426, 428; People v. Slaughter (1970), 46 Ill. 2d 114, 119.) Other evidence pointed clearly to defendant’s comprehension of his predicament.
“Fitness speaks only to a person’s ability to function within the context of trial.” (Ill. Ann. Stat., ch. 38, par. 1005 — 2—1, Council Commentary, at 220 (Smith-Hurd *4331973).) It does not refer to sanity or competence in other areas. A defendant can be fit for trial although his mind may be otherwise unsound. Withers v. People (1961), 23 Ill. 2d 131, 135; People v. Burson (1957), 11 Ill. 2d 360, 369.
The trial judge indicated he did not want to halt the proceedings for a fitness hearing but that if counsel felt there was a doubt as to defendant’s fitness she should raise it. The trial judge stated he was relying on counsel to raise the issue if she felt it was justified. He was not abrogating his duty to order a hearing on fitness but was admonishing counsel to adhere to hers.
The defendant argues that both the trial court and the appellate court operated under the misapprehension of law that it was the duty of counsel alone to request a fitness hearing. The appellate court relied on its earlier opinion in People v. Edwards (1975), 28 Ill. App. 3d 216, 219, which contains an accurate exposition of the law. That case relied in turn on this court’s opinion in People v. Skorusa (1973), 55 Ill. 2d 577,583.
The cases cited by defendant do not convince us it was error not to hold a fitness hearing. The doubt of fitness presented by the record in Pate v. Robinson (1966), 383 U.S. 375, 15 L. Ed. 2d 815, 86 S. Ct. 836, is absent here. There the United States Supreme Court held that Robinson’s history of pronounced irrational behavior required a fitness hearing. Robinson shot and kHled his girlfriend. He had suffered a blow to his head as a child and had exhibited aberrant behavior thereafter. He was treated as an in-patient at a psychiatric hospital after a display of paranoid behavior. He kUled his son and shot himself in his head. He was imprisoned and released after four years. He then küled his girlfriend. His conduct threw doubt on his ability to comprehend the nature of the crime and the proceedings.
In People v. Thomas (1969), 43 Ill. 2d 328, the *434defendant said God was his attorney, not the public defender appointed to represent him, and that he was the son of Jacob. He was of low-average intelligence. Counsel said he could not communicate with him, although psychiatric reports indicated defendant was fit. The court said:
“The consequence of a lack of co-operation, as this case illustrates, is to deny counsel access to defendant’s knowledge of the factual basis of the charges against him, or to information that might refute those charges. *** To require counsel to attempt a defense without the defendant’s cooperation thus imposes a substantial burden. Such a requirement should be imposed only when the defendant’s unresponsiveness is not the result of a lack of mental capacity.” (43 Ill. 2d 328, 332.)
A fitness hearing was required.
In People v. Burnside (1977), 52 Ill. App. 3d 524, the defendant went into a department store, took a suitcase and filled it with clothes in front of store employees. He said he was entitled to take the clothing and had done nothing wrong. There was conflicting psychiatric testimony on fitness. A fitness hearing was required.
In People v. Burson (1957), 11 Ill. 2d 360, defendant was unable to cooperate with counsel. Therefore, a fitness hearing was required. Defendant refused the assistance of the public defender. He questioned the judge and prospective jurors about their belief in God. He called his attorneys as witnesses to question them about their prejudices and about political pressure on them. He addressed them insultingly. Defendant made his own closing argument which consisted of a harangue on his religious beliefs.
In contrast the evidence here presents an educable mentally handicapped young man who comprehended his situation and recognized the nature and purpose of the *435proceedings against him and the function of an attorney to represent him. Defendant cooperated with counsel in presenting his defense.
More similar factually to this case is People v. Sephus (1970), 46 Ill. 2d 130. The record indicated that a clinical psychologist testified that, based on the results of psychological tests, defendant functioned at an intellectual level which was considered mild retardation. There was psychological testimony that the defendant could understand the proceedings against him and would be able to cooperate with counsel. The court therefore held there was no error in failing to hold a fitness hearing.
The United States Supreme Court has noted:
“There are, of course, no fixed or immutable signs which invariably indicate the need for further inquiry to determine fitness to proceed; the question is often a difficult one in which a wide range of manifestations and subtle nuances are implicated.” Drope v. Missouri (1975), 420 U.S. 162, 180, 43 L. Ed. 2d 103, 118, 95 S. Ct. 896,908.
Thus, the determination of whether there is a bona fide doubt of fitness for trial depends on the facts of each case. The trial court indicated it had no bona fide doubt of defendant’s fitness. The record supports such a conclusion. We find no abuse of discretion.
Defendant’s second claim is that he received incompetent assistance of counsel. He argues that counsel’s failure to ask for a fitness hearing and failure to present evidence indicating his mental incapacity at the hearing on the motion to suppress denied him competent assistance of counsel. Defendant also contends counsel was incompetent for failing to object to testimony by the victim’s mother.
Defendant is entitled to assistance of counsel under both the United States Constitution (Gideon v. Wainwright (1963), 372 U.S. 335, 342, 9 L. Ed. 2d 799, 804, 83 S. Ct. *436792, 795; U.S. Const., amends. VI, XIV) and the Illinois Constitution of 1970 (Ill. Const. 1970, art. I, sec. 8). Counsel, however, can be so incompetent as to undermine that right and to deprive the defendant of his due process right to a fair trial. People v. Redmond (1972), 50 Ill. 2d 313, 314-315; People v. Torres (1973), 54 Ill. 2d 384, 391; People v. Williams (1962), 26 Ill. 2d 190, 194.
A strict test is applied in determining whether privately retained counsel is incompetent:
“In such a case the court will not reverse a conviction because of the incompetency of counsel unless the representation is of such a low caliber as to amount to no representation at all or reduces the court proceedings to a farce or sham.” People v. Torres (1973), 54 Ill. 2d 384, 391. See also, e.g., People v. Redmond (1972), 50 Ill. 2d 313, 315; People v. Washington (1968), 41 Ill. 2d 16, 22.
Incompetency has been found, for example, where retained defense counsel failed to object to groundless attacks on the defendant’s character and gave an incoherent closing argument. In People v. Redmond (1972), 50 Ill. 2d 313, 315-17, counsel intermittently referred to his law practice, the strain on him that resulted from the trial, the facts of the case, and the defense during the closing argument. Counsel completely failed to represent the defendant.
Having determined that the record supports the conclusion that there was no bona fide doubt of defendant’s fitness for trial, we find that the failure on the part of defense counsel to request a fitness hearing is not indicative of a failure of adequate representation. See People v. Skorusa (1973), 55 Ill. 2d 577, 583-84.
Defendant’s second example of alleged incompetence is equally without merit. Defense counsel moved to suppress defendant’s confessions and introduced an affi*437davit in support of the motion to the effect that defendant was intellectually incapable of comprehending his confessions. However, counsel failed to introduce psychological and psychiatric testimony concerning defendant’s mental retardation at the suppression hearing. Initially, it must be noted that evidence of limited intellectual capacity does not, itself, indicate a defendant is incapable of waiving his constitutional rights and making a confession. That is but one issue to be considered in the totality of the circumstances under which the confession was made. (People v. Turner (1973), 56 Ill. 2d 201, 216; People v. Hester (1968), 39 Ill. 2d 489, 500; People v. Simmons (1975), 60 Ill. 2d 173, 181.) Evidence introduced by the State at the hearing on the motion to suppress indicated that defendant’s rights were carefully explained to him in defined terminology he could understand. Defendant read and indicated he understood his statements. At the conclusion of the hearing, the trial court properly determined that defendant intelligently and knowingly waived his Miranda rights.
Counsel moved to suppress the confessions. She raised the question of defendant’s intellectual limitations and filed an affidavit in support of that contention. But the State introduced strong countervailing evidence. Counsel’s failure to introduce testimony concerning defendant’s retardation did not render her representation a nullity or reduce the proceedings to a farce or a sham. Competency is determined from the totality of counsel’s conduct at trial. People v. Steel (1972), 52 Ill. 2d 442, 453;People v. Somerville (1969), 42 Ill. 2d 1, 5.
Counsel’s judgment in not introducing more evidence may have been in error. But errors in judgment or trial strategy do not establish incompetency. People v. Torres (1973), 54 Ill. 2d 384, 392;People v. Redmond (1972), 50 Ill. 2d 313, 314-15; People v. Green (1967), 36 Ill. 2d 349, 351.
*438The mere fact that counsel was unable to secure the suppression of the confessions does not constitute incompetence. A defendant is entitled to competent, not perfect or successful, representation. See People v. Torres (1973), 54 Ill. 2d 384, 391; 14A Ill. L. & Prac. Criminal Law sec. 499, at 513 (1968).
The third basis for the assertion of incompetence was counsel’s failure to object to testimony by the victim’s mother. The mother related the account of the molestation the child told her within one hour of the incident. The briefs highlight the reason we conclude the failure to object was not an indication of incompetency; without resolving the substantive question of whether the testimony was admissible, we note that the point was sufficiently unclear that both parties reasonably cite the same case to support opposite conclusions concerning the admissibility of the testimony (People v. Damen (1963), 28 Ill. 2d 464).
While failure to object may have been poor judgment, it did not amount to no representation or turn the proceedings into a farce. In any event, incompetency is not established by mere failure to object to inadmissible evidence. People v. Somerville (1969), 42 Ill. 2d 1, 5.
Defendant asks this court to adopt a new standard by which to measure the competency of counsel. The Seventh Circuit adopted the proposed standard in United States ex rel. Williams v. Twomey (7th Cir. 1975), 510 F.2d 634, 640. The court determined that counsel’s conduct was short of the expected professional standard of competent counsel. Defendant’s attorneys failed to seek a postponement until they could learn his co-defendant’s story and establish his willingness to testify. There were no disinterested witnesses, and defendant’s testimony was vulnerable because of his prior criminal record.
Without adopting the proposed standard, we do not believe that defense counsel violated it. Counsel vigorously *439represented defendant through two trials. In the first, the jury was unable to reach a verdict. The second ended in acquittal on one of the two counts charged. Defendant received competent representation throughout the proceedings.
Defendant’s final contention is that his sentence of 12 to 70 years is excessive. Defendant was convicted of indecent liberties with a child. This is a Glass 1 felony (Ill. Rev. Stat. 1973, ch. 38, par. 11 — 4) for which the penalty is any term of imprisonment in excess of four years (Ill. Rev. Stat. 1973, ch. 38, par. 1005 — 8—1(b)(2)).
This court recently held in People v. Heflin (1978), 71 Ill. 2d 525, 545, that it “will not disturb a sentence imposed by the trial court unless it clearly appears that the penalty constitutes a great departure from the fundamental law and its spirit and purpose. (People v. Taylor (1965), 33 Ill. 2d 417.) In this State, the spirit and purpose of the law are upheld when a sentence reflects the seriousness of the offense and gives adequate consideration to the rehabilitative potential of the defendant. See Ill. Const. 1970, art. I, sec. 11.”
In imposing sentence here, the trial judge stated he considered defendant’s age, the nature of his offense, his educational and family backgrounds, and the nature and character of defendant himself, including his limited mental acuity. The trial court considered the seriousness of the offense, an act of sexual intercourse on the part of an adult male with a 6-year-old child. The trial court concluded that defendant should be incarcerated for a sufficient length of time to be treated and that the maximum term should be long enough to protect society in the event defendant does not respond to treatment.
The trial court reached its decision after consideration of proper factors. The sentence should not be disturbed.
The judgment of the appellate court is affirmed.