the algorithm used for this ai