switched back to old ai.py, giving up on cython for now