public void update() {
        int liveCount = 0;
        Iterator<Cell> it = adj.iterator();
        while (it.hasNext()) {
            Cell cell = it.next();
            if (cell.getState() > 0)
                liveCount = liveCount + 1;
        }

        /* Like the original, but if we remain alive, we grow */
        if (curState > 0 && (liveCount == 2 || liveCount == 3))
            nextState = curState + 1;
        else if (curState == 0 && liveCount == 3)
            nextState = 1;
        else
            nextState = curState - Math.min(Math.abs(liveCount - 2), 3);

        if (nextState > 3)
            nextState = 3;
        if (nextState < 0)
            nextState = 0;
    }