sort the moves to speed up the search