public ControllerV1(int threads, int limit, boolean gui) {
        this.threads = threads * threads;
        this.limit = limit;

        this.groupFuturePrimes = new ArrayList<>();
        this.groupPrimes = new ArrayList<>();

        this.executorService = Executors.newFixedThreadPool(1 + this.threads);

        this.initPrimes(gui);

        if (gui) {
            this.panel = new ControlPanel(new ControlLamp(this.mainPrime), this.initLamps());
            new ControlWindow(this.panel);
        }

        this.startPrimes();

        while (!this.mainFuturePrime.isDone()) {
            if (gui) {
                this.panel.repaint();
            }
        }

        this.executorService.shutdownNow();

        if (gui) {
            while (!this.executorService.isTerminated()) {
                this.panel.repaint();
            }
        }

        System.out.println("done");
    }