added aiSelect method