add some AI functions