working on ai.py fixup.