private void buildFinalResult()
    {
        int nrPlayers = profiles.size();
            
        double[] wins = new double[nrPlayers];
        double[] loses = new double[nrPlayers];
        double[] ties = new double[nrPlayers];
            
        for (int j = 0; j < nrPlayers; j++) {
            wins[j] = loses[j] = ties[j] = 0;
        }
            
        //sum up all the percentages
        for (int i = 0; i < nrOfWorkers; i++) {
            SimulationWorkerResult result = workers.get(i).getResult();
                
            for (int j = 0; j < nrPlayers; j++) {
                wins[j] += result.getWinPercentage(j);
                loses[j] += result.getLosePercentage(j);
                ties[j] += result.getTiePercentage(j);
            }
        }
            
        //average is needed, so... divide
        for (int j = 0; j < nrPlayers; j++) {
            wins[j] /= nrOfWorkers;
            loses[j] /= nrOfWorkers;
            ties[j] /= nrOfWorkers;
        }

        long duration = endTime - startTime;
            
        ResultBuilder resultBuilder = new SimulationFinalResult.ResultBuilder().setGameType(gameType)
                                                                                .setPlayers(profiles);
            
        //flop is set
        if (communityCards[0] != null) {
            resultBuilder.setFlop(Arrays.copyOfRange(communityCards, 0, 3));
        }
            
        simulationResult = resultBuilder.setTurn(communityCards[3])
                                        .setRiver(communityCards[4])
                                        .setWins(wins)
                                        .setTies(ties)
                                        .setLoses(loses)
                                        .setRounds(nrRounds)
                                        .setThreads(nrOfWorkers)
                                        .setDuration(duration)
                                        .build();
    }