working out bugs in the new AI
AI made more robust
merged new ai