public static double[][] calculcateDistanceMatrixThreaded(Map imagesTags, ArrayList<String> representativeTags) {

        /* Initialise matrix with amountTags * amountTags; right now only a tenth! */
        int amountTags = imagesTags.size();
        int poolSize = amountTags / TEST_POOL_SIZE_DIVISION;
        double[][] distanceMatrix = new double[poolSize][poolSize];

        /* Load all tags in map */
        ArrayList<String> tagpool = createTagPool(imagesTags);

        if (PRINT == 1)
            System.out.println(tagpool);

        /* Calculate a map with the tags and their corresponding histogramme */
        Map<Integer, ArrayList> histogramms = new HashMap();
        for (int i = 0; i < poolSize; i++) {
            ArrayList<Integer> cooccurrence = calculateCooccurrences(tagpool.get(i), representativeTags, imagesTags);
            histogramms.put(i, cooccurrence);
        }

            /* Go through those histogramms and calculate Jenson-Shanon-Divergence for each pair */
        for (int i = 0; i < poolSize; i++) {
            System.out.print(i + ", ");
            for (int i2 = i + 1; i2 < poolSize; i2++) {
                try {
                    distanceMatrix[i][i2] = divergenceOfHistogrammes(histogramms.get(i), histogramms.get(i2));
                } catch (Exception e) {
                    System.out.println("i:" + i + "; i2:" + i2 + "; amountTags/TEST_POOL_SIZE_DIVISION :" + poolSize);
                    System.exit(-1);
                }

            }
        }

        System.out.println("");
        writeDistanceMatrixIntoFile(distanceMatrix);

        return distanceMatrix;

    }