finished the AI integration