Re-organized perform_move().