Further changes to AI module