Working version of Jason's non-threaded AI, with option of using multithreaded