understanding AI algorithms