n. mental illness of such a severe nature that a person cannot distinguish fantasy from reality, cannot conduct her/his affairs due to psychosis, or is subject to uncontrollable impulsive behavior. Insanity is distinguished from low intelligence or mental deficiency due to age or injury. If a complaint is made to law enforcement, to the District Attorney or to medical personnel that a person is evidencing psychotic behavior, he/she may be confined to a medical facility long enough (typically 72 hours) to be examined by psychiatrists who submit written reports to the local superior/county/district court. A hearing is then held before a judge, with the person in question entitled to legal representation, to determine if she/he should be placed in an institution or special facility. The person ordered institutionalized at the hearing may request a trial to determine sanity. Particularly since the original hearings are often routine with the psychiatric findings accepted by the judge. In criminal cases, a plea of "not guilty by reason of insanity" will require a trial on the issue of the defendant's insanity (or sanity) at the time the crime was committed. In these cases the defendant usually claims "temporary insanity" (crazy then, but okay now). The traditional test of insanity in criminal cases is whether the accused knew "the difference between right and wrong," following the "M'Naughten rule" from 19th century England. Most states require more sophisticated tests based on psychiatric and/or psychological testimony evaluated by a jury of laypersons or a judge without psychiatric training. A claim by a criminal defendant of his/her insanity at the time of trial requires a separate hearing to determine if a defendant is sufficiently sane to understand the nature of a trial and participate in his/her own defense. If found to be insane, the defendant will be ordered to a mental facility, and the trial will be held only if sanity returns. Sex offenders may be found to be sane for all purposes except the compulsive dangerous and/or antisocial behavior. They are usually sentenced to special facilities for sex offenders, supposedly with counseling available. However, there are often maximum terms related to the type of crime, so that parole and release may occur with no proof of cure of the compulsive desire to commit sex crimes.