A motion to determine competency (mental state of mind of the defendant at time of trial as opposed to insanity would be mental state at the time the cri me was committed) is decided by the judge who determines if the defendant 1) is able to understand the nature and purpose of the proceedings and 2) has the ability to assist his counsel in his defense.