moved some ai utility functions to ai_utils.c