Added AI functionality and added messages