Added AI functions
merged with Tashs AI stuff