public static void main(String[] args) {
		// Get and handle Command line arguments
		if (args.length > 0) {
			for (int i = 0; i < args.length; i++) {
				if (args[i].equals("debug")) debug = true;
			}
		}

		// Create main GUI
		new GUI();
		GUI.Append("Starting server on port: " + serverPort);
		
		// Handle files
		if (!debug) {
			GUI.Append("Checking for server files..");
			if (!FileCreate.Check()) {
				if (!FileCreate.Create("")) PopupManager.CloseWithError("Server could not create files.");
				FileWrite.WriteConfig();
			} else {
				new FileClear("users");
				FileRead.ReadHistory();
				FileRead.ReadOPs();
				FileRead.ReadConfig();
			}
		} else {
			GUI.Append("Running in debug mode!");
		}
		
		if (serverName.equals("Default Name")) defName = true;
		
		// Start listening
		if (!defName) {
			startServer();
		} else { 
			if (!debug) {
				String s = PopupManager.ShowInput("Server Name:", "Server Name");
				serverName = s;
				FileWrite.WriteConfig();
				startServer();
			} else {
				startServer();
			}
		}
	}