Code for Artifical Intellegence class.