
446 N.W.2d 49 (1989)
Edward J. GROSS, Petitioner and Appellant,
v.
Herman SOLEM, Respondent and Appellee.
No. 16126.
Supreme Court of South Dakota.
Argued February 14, 1989.
Decided September 6, 1989.
*50 Thomas Harmon, Deputy Atty. Gen., Pierre, for respondent and appellee; Roger A. Tellinghuisen Atty. Gen., on the brief.
Richard Braithwaite, Sioux Falls, for petitioner and appellant.
MORGAN, Justice.
This is an appeal from the decision of the trial court (habeas court) denying habeas corpus relief to Edward Gross (Gross) who was convicted upon his plea of guilty but mentally ill to manslaughter in the first degree. We affirm.
On October 31, 1986, Gross shot and killed his estranged wife outside her home. He holed up in the home for several hours before surrendering to authorities. Gross was subsequently indicted on a charge of murder in the first degree to which he entered a plea of not guilty and not guilty by reason of insanity. The trial court ordered a psychiatric examination. After the examination, Gross indicated that he intended to plead guilty to a reduced charge of first-degree manslaughter, pursuant to an intended plea-bargain agreement.
During the plea change/sentencing hearing, Gross amended his guilty plea to guilty but mentally ill. Upon acceptance of his plea, the trial court entered judgment and sentenced Gross to seventy-five years in the South Dakota State Penitentiary. Gross did not file a direct appeal. In 1987, Gross petitioned for a writ of habeas corpus. The habeas court entered an order denying Gross' petition.
On appeal, Gross raises the following issues:
1. Whether he was denied effective assistance of counsel;
2. Whether any of the following alleged irregularities in sentencing provide grounds for habeas corpus relief:
a. the sentencing was venued in a different county from the one where the offense occurred,
b. the trial court failed to order a competency hearing prior to sentencing, and
c. no factual basis was established for the mentally ill portion of his plea, and
3. Whether Gross' plea was involuntary because:
a. he was unaware or did not fully understand the proceedings, and
b. he was influenced by the trial court informing him that the psychiatrists had found him to be sane at the time of the offense.
We first set forth our scope of review. Since habeas corpus is in the nature of a collateral attack upon a final judgment, the scope of review is limited. Satter v. Solem, 422 N.W.2d 425 (S.D.1988); Goodroad v. Solem, 406 N.W.2d 141 (S.D.1987).
Habeas corpus can be used only to review (1) whether the court had jurisdiction of the crime and the person of the defendant; (2) whether the sentence was authorized by law; and (3) in certain cases, whether an incarcerated defendant has been deprived of basic constitutional rights.
Satter, 422 N.W.2d at 427; Goodroad, 406 N.W.2d at 144; State ex rel Burns v. Erickson, 80 S.D. 639, 645, 129 N.W.2d 712, 715 (1964). Further, the burden of proof is upon Gross. Goodroad at 145.
Gross first contends that he was denied his constitutional right to effective assistance of counsel. He argues that his trial counsel's performance was deficient in several areas and that these errors, individually and collectively, prejudiced his defense.
*51 We start with the presumption that Gross' attorney is competent until Gross makes a showing to the contrary. It is his burden to establish ineffective assistance of counsel. Jibben v. State, 343 N.W.2d 788 (S.D.1984); Grooms v. State, 320 N.W.2d 149 (S.D.1982); State v. Pieschke, 262 N.W.2d 40 (S.D.1978); State v. Roth, 84 S.D. 44, 166 N.W.2d 564 (1969).
In Jones v. State, 353 N.W.2d 781 (S.D.1984), we adopted the standard for determining ineffective assistance of counsel as set forth in Strickland v. Washington, 466 U.S. 668, 104 S.Ct. 2052, 80 L.Ed.2d 674 (1984).
The benchmark for judging any claim of ineffectiveness must be whether counsel's conduct so undermined the proper functioning of the adversarial process that the trial cannot be relied on as having produced a just result. To reverse a conviction on ineffective assistance grounds, a defendant must show: 1) that counsel's performance was deficient; and 2) that the deficient performance prejudiced the defense. The test for prejudice is whether there is a reasonable probability that, but for counsel's unprofessional errors, the result of the proceeding would have been different.
Jones, 353 N.W.2d at 784.
Gross argues that his counsel was deficient insofar as he (1) failed to schedule his personal affairs to meet Gross' demands; (2) did not discuss an intoxication defense with Gross; (3) refused to follow Gross' trial strategies; (4) did not discuss the location of the sentencing hearing with Gross; (5) failed to provide individuals to assist the psychiatrist in preparing his report; and (6) pressured Gross to plead.
After examining the record, we hold that Gross has failed to demonstrate that his counsel's performance and advice was clearly deficient as required by Strickland and Jones, supra. Since Gross has failed to show clear deficiencies, we need not reach the second prong of our test.
Gross next contends that irregularities during sentencing procedures provide grounds for habeas corpus relief. Basically, his argument is threefold. First, he argues that the trial court did not have jurisdiction at the time it imposed sentence because the hearing was venued in a different county from the one where the offense occurred. Secondly, he argues that the trial court failed to find a factual basis for Gross' guilty but mentally ill plea as required by SDCL 23A-7-16. Lastly, he argues that the trial court erred in failing to order a competency hearing before accepting Gross' plea. We will address each of Gross' arguments in turn.
Clearly, a defendant has a constitutional and statutory right to a trial by a jury of the county in which the offense occurred. South Dakota Constitution art. VI, § 7; SDCL 23A-16-5. However, there is no tantamount right to be sentenced in the county in which the offense occurred. Croan v. State, 295 N.W.2d 728 (S.D.1980); State v. Erickson, 83 S.D. 79, 155 N.W.2d 313 (1967). In Croan, 295 N.W.2d at 729, citing Erickson, supra, we said:
`Because the jurisdiction of the circuit court, ... is not limited to any particular county but extends throughout the state, there is no violation of [this constitutional] mandate if the accused is arraigned and sentenced upon a plea of guilty in another county.'
Based on this settled law, Gross' plea and imposition of sentence were within the trial court's jurisdiction. Therefore, this issue is without merit.
Gross also contends that there was an insufficient factual basis to find him mentally ill at the time of the offense, pursuant to SDCL 23A-7-16, 23A-7-14, and 22-1-2(24). Further, that the trial court did not rule on this issue. In Goodroad, 406 N.W.2d at 145, we held that the factual predicate of a guilty plea could not be raised in a habeas corpus review:
Since the factual basis requirement rests in statute and not the constitution, we would normally not review this claim in a habeas corpus action....
More recently, in Everitt v. Solem, 412 N.W.2d 119 (S.D.1987), we reaffirmed this position in a guilty but mentally ill case. Just as Gross does here, Everitt claimed *52 there was insufficient evidence to support the mentally ill determination as required in SDCL 23A-7-16. In rejecting this attack, we stated:
Habeas corpus is not the proper remedy to correct irregular procedures, rather, in the context of post-conviction attacks on the conviction itself, habeas corpus reaches only jurisdictional error.... In this case, the trial court had jurisdiction of the person and of the subject matter before it. The sentence was authorized by law. Everitt has not been deprived of basic constitutional rights.
Everitt at 121.
Similarly, the trial court had jurisdiction of the person and subject matter. Croan, 295 N.W.2d at 729. We note as a relevant aside that lack of any jurisdictional defect precludes the expansive construction of what may be properly considered in habeas corpus that we allowed in Security Sav. Bank v. Mueller, 308 N.W.2d 761 (S.D.1981). Any procedural defects in Gross' conviction do not rise to constitutional dimensions.
Gross concedes that the trial court did not rule that a factual basis existed to find him mentally ill at the time of the offense. Without that ruling, the issue is not subject to habeas corpus review. Everitt, 412 N.W.2d at 121; Goodroad, 406 N.W.2d 141.
Gross also contends that the sentencing court should have ordered a competency hearing before accepting his plea. It is clear that the ordering of a competency hearing rests within the trial court's sound judicial discretion and its decision will not be disturbed in the absence of an abuse of that discretion. State v. Vassar, 279 N.W.2d 678 (S.D.1979); Magenton v. State, 76 S.D. 512, 81 N.W.2d 894, 897 (1957).
Sanity is presumed. Magenton 81 N.W.2d at 897. Sanity or competency, for purposes of triability or sentencing, is not the right and wrong rule, but is determined by appraising a defendant's present ability to understand the nature and purpose of the proceedings taken against him, and to assist counsel in his own defense. Magenton, supra; Vassar, supra. Only if facts and circumstances in the case raise a real doubt in the mind of the trial court is Gross entitled to a hearing of the issue of his present competency. Vassar, supra.
Based on the record in this case, we cannot say, as a matter of law, that the trial court should have had any real doubt concerning Gross' competency at the time of sentencing. Gross asked sophisticated questions about the proper procedures to conduct a psychiatric exam. He asserted himself and asked to examine a psychiatric report he had not seen. After he had read this document, he was able to capsulize the important findings it made. Finally, he gave a logical speech thanking members of his family and his attorney for their assistance, pointing out mitigating factors to his crime, and asking the court to show mercy in his case. Gross' actions at sentencing indicate his ability to understand the nature and purpose of the proceeding. We find no abuse of discretion.
Finally, we reach Gross' last issue. He contends that his plea was involuntary because it was coerced by misinformation and because he was unaware or did not fully understand the sentencing proceeding. Further, that a conviction and sentence based upon this involuntary plea may not stand.
In anticipation of trial, and later upon motion of Gross, two psychiatrists, Dr. Frank Johnson (Johnson) and Dr. Thajammul Bhatti (Bhatti), were appointed to examine Gross. A copy of Johnson's report had been furnished to Gross and he understood that Johnson believed he was sane at the time of the offense. During the course of the hearing, the trial court informed Gross that it did not know if the issue of insanity could be presented to a jury because Bhatti's opinion was that while Gross was presently mentally ill he still knew the difference between right and wrong. Gross' counsel corrected the court as to Bhatti's conclusion. When Gross informed the court that he had not read Bhatti's report, the court ordered a recess in order for Gross and counsel to review it.
*53 After the recess, Gross informed the court that "Dr. Bhatti says I'm mentally ill, and he couldn't make a determination one way or the other whether I knew right from wrong at the time of the accident. My wife's death." The trial court responded: "I think that is correct. I think that is what he said."[1] We agree with this assessment of Bhatti's testimony. At this point, Gross requested information regarding a plea of guilty but mentally ill and subsequently amended his plea in that fashion.
On this appeal, Gross asserts that the trial court's initial misunderstanding of the content of Bhatti's psychological evaluation influenced his decision to plead. Further, that he was not aware of what was happening at the hearing. Gross' allegation that his plea was not knowing and voluntary does raise a constitutional issue, requiring us to examine the procedure used in accepting his guilty but mentally ill plea. Our inquiry will be two-fold: (1) Whether the trial court adequately complied with SDCL 23A-7-16, and (2) Whether Gross understood this procedure. SDCL 23A-7-16 states:
In addition to the requirements of §§ 23A-7-4 and 23A-7-5, if a defendant charged with a felony pleads guilty but mentally ill, the court may not accept the plea until the defendant has been examined by a licensed psychiatrist and the court has examined the psychiatric reports. The court shall hold a hearing on the defendant's mental condition and if there is a factual basis on which the court can conclude that the defendant was mentally ill at the time of the offense, the plea shall be accepted.
As a prerequisite to the mental illness determination, the trial court must have found a factual basis for Gross' plea to manslaughter in the first degree. Not only did the trial court have Gross' confession to DCI agents admitting shooting his wife with a dangerous weapon, a shotgun, but it also had his in-court admissions of every element of the crime as well. We find an adequate factual basis for the charged offense. Spirit Track v. State, 272 N.W.2d 803 (S.D.1978).
Second, SDCL 23A-7-16 requires that Gross be examined by a licensed psychiatrist and that the court examine this report. In this case, Gross was examined by two licensed psychiatrists, Johnson and Bhatti. The trial court examined both of these reports and discussed them with Gross and his attorney.
Third, the trial court did hold a hearing, albeit brief, on Gross' mental condition. The statute does not, as Gross suggests, require a special hearing. During a change of plea/sentencing hearing, Gross raised the issue of his mental illness at the time of the offense. Gross indicated he had not read Bhatti's report and was given a recess to examine the report with his attorney. Upon Gross' return to the court-room, the trial court held the hearing mandated by the statute. Gross was present with counsel, allowed to ask questions, and had the right to bring matters to the court's attention. When the trial court was satisfied that Gross understood Bhatti's report, Gross was allowed to change his plea to guilty but mentally ill. We find that the trial court provided an adequate hearing on Gross' mental condition.
Fourth, there was an adequate factual basis for the trial court to conclude that Gross was mentally ill at the time of the offense. While it is true that the trial judge initially stated that Bhatti could not determine whether Gross was mentally ill on October 31, 1986, we believe that this finding was either clearly erroneous or, more likely, an inadvertent misstatement. This statement was made before the trial judge reexamined Bhatti's report and accepted Gross' plea. In any event, the error was harmless because adequate evidence exists on the record to uphold the guilty but mentally ill plea.
*54 Bhatti concluded that Gross suffered from a schizophrenic disorder. In the American Psychiatric Association Diagnostic and Statistical Manual of Mental Disorders 181 (Third Edition 1980), schizophrenic disorders are classified as severe psychiatric disorders affecting a patient's mental process and judgment. This diagnosis clearly meets our state's definition of mental illness.[2] Bhatti diagnosed Gross as having this mental illness in September, 1986, as well as in December 1986. Though Bhatti was reluctant to say Gross had the mental illness on October 31, 1986, he did say that the mental illness was chronic and that if Gross had it in September and December, 1986, he had it on October 31, 1986. In addition to this medical testimony, Gross stated that he was mentally ill on the day of the crime and his attorney agreed. All this evidence allowed the trial judge to conclude that Gross was mentally ill at the time of the offense. Everitt, 412 N.W.2d at 122 (diagnosis of mental illness close in time to crime is relevant and valuable in allowing a judge to form the subjective conclusion of mental illness).
Finally, the record shows clearly that the trial court made every effort to ensure that Gross understood the proceedings and the content of the psychological evaluations. Gross was given a recess to read the evaluation and discuss its findings with his attorney and brother. The court asked if Gross needed more time to examine the report, and he said "No." Gross demonstrated his awareness during sentencing by correctly summarizing Bhatti's deposition on his own initiative and by amending his plea. As discussed earlier, his interaction with the trial court and his attorney attest to an individual fully aware of what was transpiring and actively participating in his defense. Therefore, on these facts, we deem Gross' plea to be voluntary.
We affirm the order of the habeas court entered below.
WUEST, C.J., and MILLER, J., concur.
SABERS, J., concurs in part and concurs in result in part.
HENDERSON, J., dissents.
SABERS, Justice (concurring in part and concurring in result in part).
I write again to point out that habeas corpus reaches jurisdictional error, constitutional error, all "causes" listed in SDCL 21-27-16(1) through (7), and other illegal detentions, including those resulting from failure to comply with "substantive statutory procedures." Security Sav. Bank v. Mueller, 308 N.W.2d 761, 762 (S.D.1981). See also my special concurrences in Everitt v. Solem, 412 N.W.2d 119, 123 (S.D.1987); Podoll v. Solem, 408 N.W.2d 759, 761 (S.D.1987); and in Goodroad v. Solem, 406 N.W.2d 141, 146 (S.D.1987).
SDCL 21-27-16(3) provides that habeas corpus will lie "[w]here the process is defective in some substantial form required by law[.]" SDCL 23A-7-16 provides that a guilty but mentally ill plea cannot be received absent a showing of a factual basis from which the trial judge can conclude the defendant was mentally ill at the time of the offense.
Habeas corpus is the proper remedy here because this is a claim that the process was defective in a substantial form required by law. To hold otherwise is equivalent to "judicially" writing SDCL 21-27-16(3) completely out of the habeas corpus statute. SDCL 21-27-16. Therefore, this claim must be examined on its merits. However, when examined on its merits, it does not warrant reversal because the showing of a factual basis was sufficient, though barely.
HENDERSON, Justice (dissenting).
I respectfully dissent, for the reasons expressed in my special writings in State v. Robinson (Robinson I), 399 N.W.2d 324, *55 327-30 (S.D.1987) (Henderson, J., concurring in part and dissenting in part), and Robinson v. Solem (Robinson II), 432 N.W.2d 246, 252-8 (S.D.1988) (Henderson, J., dissenting).
NOTES
[1]  We note that the trial court examined both Dr. Bhatti's report and his deposition. Gross did not include the report as part of the record. This deposition, however, was included in the record and used by the trial judge in forming his opinion of mental illness. We consider it to be representative of what was contained in the report.
[2]  SDCL 22-1-2(24) states:

"`Mental illness,' a substantial psychiatric disorder of thought, mood or behavior which affects a person at the time of the commission of the offense and which impairs a person's judgment, but not to the extent that he is incapable of knowing the wrongfulness of his act. Mental illness does not include abnormalities manifested only by repeated criminal or otherwise antisocial conduct."
