private static String getName(int playerNum, String prevName){ 
		String name;
		
		while(true){
			System.out.print("Player " + playerNum + " please enter your name.\n>> ");
			name = scanner.nextLine().trim();
			
			//if there is no spaces and it is not empty and names are not the same
			if(!name.isEmpty() && !(name.contains(" ") || name.contains("\t")) && !name.equals(prevName)) 
				
				break; //otherwise the user will be asked to enter again
			else
				System.out.println("Invalid name. Try again.");
		}
		return name;
	}