AI integration

even more AI stuff ( a lot of bugs still)