Implemented AI in UI

Still bugs - look in comments