The State of Alaska has one of the strictest tests in the nation for establishing the defense of insanity.  It's ludicrous and was done to make sure that even extremely mentally ill people get punished for crimes, hence, "guilty but mentally ill verdicts."