enhance ai module #2

enhance again, thanks for merging previous PR :)