function nextMove(square) {
	if(document.winner != null){
		setMessage(document.turn.charAt(0) + " already won.")
	} else if(square.innerText == '') {
	
	//This if writes out the exponent of the x or o		
	var x = document.turn;
	var val = x.charAt(0);

		if(val == 'x'){
			square.innerText = document.turn + countX;
			countX++;
		}else{
			square.innerText = document.turn + countO;
			countO++;
		}
		
		removeOverflow(square.innerText);
		
		switchTurn(); 

	//If the square that you selected is already in use/an x or o already exists
	} else {
		setMessage("pick another square");
	}
	countBox--;
}
//then it either runs the switchTurn function or tells the user to select another square
then it either runs the switchTurn function or tells the user to select another square
then it either runs the switchTurn function or tells the user to select another square
function nextMove(square) {
	if(document.winner != null){
		setMessage(document.turn.charAt(0) + " already won.")
	} else if(square.innerText == '') {
	var x = document.turn;
	var val = x.charAt(0);
		if(val == 'x'){
			square.innerText = document.turn + countX;
			countX++;
		}else{
			square.innerText = document.turn + countO;
			countO++;
		}
		removeOverflow(square.innerText);
		switchTurn(); 
	} else {
		setMessage("pick another square");
	}
	countBox--;
}
function nextMove ( square ) { if ( document . winner != null ) { setMessage ( document . turn . charAt ( 0 ) + " already won." ) } else if ( square . innerText == '' ) { var x = document . turn ; var val = x . charAt ( 0 ) ; if ( val == 'x' ) { square . innerText = document . turn + countX ; countX ++ ; } else { square . innerText = document . turn + countO ; countO ++ ; } removeOverflow ( square . innerText ) ; switchTurn ( ) ; } else { setMessage ( "pick another square" ) ; } countBox -- ; }
then it either runs the switchTurn function or tells the user to select another square
then it either runs the switchTurn function or tells the user to select another square
//This if writes out the exponent of the x or o		 //If the square that you selected is already in use/an x or o already exists