public static void main(String[] args) throws OlympicException {
		long TIME_DELAY = 20 * 1000;
		long SLEEP_DURATION = (long) 5.1 * 1000;
		String serviceFinderHost = null;

		if(args.length < 1) {
			usage();
			System.exit(-1);
		} else {
			serviceFinderHost = args[0];
		}
		
		int serviceFinderPort = (args.length < 2) ? DEFAULT_JAVA_RMI_PORT : Integer
				.parseInt(args[1]);
		JAVA_RMI_PORT = (args.length < 3) ? DEFAULT_JAVA_RMI_PORT : Integer
				.parseInt(args[2]);
		Games game = new Games("Pompeii", "48 BC");
		game.setServiceFinderAddress(serviceFinderHost, serviceFinderPort);
		int numEvents = game.events.size();

		game.printGameIntro();
		try {
			ServerDetail cacophonixDetail = game
					.getServerDetails(CACOPHONIX_SERVICE_NAME);
			Registry registry = LocateRegistry.getRegistry(
					cacophonixDetail.getServiceAddress(),
					cacophonixDetail.getServicePort());
			final CacophonixInterface stub = (CacophonixInterface) registry
					.lookup(cacophonixDetail.getServerName());
			for (int i = 0; i < numEvents; i++) {
				Event simulatedEvent = game.simulateNextEvent();
				System.err.println("Beginning "
						+ simulatedEvent.getName().getCategory() + ".");
				if (simulatedEvent != null) {
					while (!simulatedEvent.isCompleted()) {
						System.err.println("Sending latest scores.");
						ArrayList<Athlete> currentScores = simulatedEvent
								.getScores();
						stub.updateCurrentScores(simulatedEvent, currentScores);
						Thread.sleep(SLEEP_DURATION);
					}
					System.err.println("Sending final results.");
					stub.updateResultsAndTallies(simulatedEvent);
				}
				Thread.sleep(TIME_DELAY);
			}
			//System.err.println("Games ended. Now conducting lucky raffle.");
			//printCongratulatoryMsg(stub.conductLottery());

		} catch (NotBoundException e) {
			throw new OlympicException("Cannot find Cacophonix.", e);
		} catch (RemoteException e) {
			throw new OlympicException("Error while broadcasting.", e);
		} catch (InterruptedException e) {
			throw new OlympicException("Games Interrupted.", e);
		}

	}