Added functions for the AI