Declared algorithm in the doBestMove method