Issues with AI implementation