public Server() {
        outputArray = new ByteArrayOutputStream();
        try {
            outputStream = new ObjectOutputStream(new BufferedOutputStream(outputArray));
        } catch (IOException e) {
            e.printStackTrace();
        }

        running = true;
        clientList = new HashMap<InetSocketAddress, Integer>(MAX_PLAYERS);
        players = 0;

        net = new ServerSock(this);
        sim = new Simulation();
        new Thread(net).start();
        new Thread(sim).start();

        while (players < 1) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        while (running) {
            // TODO: this seems dumb just to get a byte array, find a better way
            try {
                outputArray.reset();
                outputStream = new ObjectOutputStream(outputArray);

                outputStream.writeByte(Network.UPDATE);
                outputStream.writeObject(sim.getState());
                outputStream.flush();
                state = outputArray.toByteArray();
            } catch (IOException e) {
                e.printStackTrace();
            }

            for (InetSocketAddress i : clientList.keySet()) {
                //System.err.println(i);
                net.send(i, state);
            }

            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }