Some new functions for AI