added ai mode