public static void main(String args[]) {

                label = new JLabel();
                frame.setMinimumSize(new Dimension(500, 200));
                frame.setBounds(100,100,450,300);
                label.setText("Clients can be run now to play the game. To quit, press end game.");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
                frame.setVisible(true);
                frame.setLayout(new BorderLayout());
                end.addActionListener(endgame);
                frame.add(label, BorderLayout.EAST);
                frame.add(end, BorderLayout.WEST);
                
                
		int portNumber = 9000;

		//Optional portNumber add feature
		if (args.length < 1) {
			System.out.println("portNumber= " + portNumber);
		} else {
			portNumber = Integer.valueOf(args[0]).intValue();
		}

		try {
			serverSocket = new ServerSocket(portNumber);
		} catch (IOException e) {
			System.out.println("IOException: " + e);
		}
		QuitCheck check = new QuitCheck();
                check.start();

		// Accepts max number of clients (4) to server
		while (true) {
			try {
				clientSocket = serverSocket.accept();
				int i = 0;
				for (i = 0; i < maxClients; i++) {
					if (threads[i] == null) {
						System.out.println("New connection!");
						(threads[i] = new ClientThread(clientSocket, threads, gameBoard, i)).start();
						break;
					}
				}
				if (i == maxClients) {
					PrintStream os = new PrintStream(clientSocket.getOutputStream());
					os.println("Server too busy. Try later.");
					os.close();
					clientSocket.close();
				}
			} catch (IOException e) {
				System.out.println("IOException" + e);
			}
                        
		}
                
	}