A Colorado judge has accepted a plea of not guilty by reason of insanity for alleged theater shooter James Holmes, the AP reports. Now begins an evaluation of Holmes by state doctors to determine whether was insane at the time of the shootings in Aurora, CO. That process could take months. Holmes is accused of killing 12 moviegoers during a shooting spree last summer at a Cinemark theater midnight showing of The Dark Knight Rises. He is charged with 166 counts of murder, attempted murder and other crimes. Holmes originally had a not guilty plea entered on his behalf, but his lawyers later offered a deal in which he was willing to plead guilty and spend the rest of his life in prison. The Arapahoe County District Attorney rejected the plea deal in April and said he would seek the death penalty in the case. The insanity plea is widely seen as Holmes’ best chance of avoiding execution given the extent of evidence against him.