Added AI functions