my changes in selectBestMove function