+ fix "different error units" bugs
+ refactor ai.py