Added beginning of AI, fixed warnings