add test function to Ai