two things define insanity in the courts : first , that a defendant was unable to determine right from wrong at the time of the crime , and second , that the defendant was unable to appreciate the consequences of his actions at the time of the crime .