changed variable names in #next_move to make it more readable