Finished ai-move-intm function.