public static ArrayList getRepresentativeTags(Map imagesTags, int percentage) {

        ArrayList representativeTags = new ArrayList<String>();

        /*
            1. Create Map "tagpool" tag => count (0)
            2. Count all occurrences and add to tag pool
            3. Choose "int count" REFERENCE_TAG_PERCENTAGE, minimum MIN_REFERENCE_TAG_COUNT
        */
        Map tagpool = countOccurrences(imagesTags);

        if (PRINT == 1)
            System.out.println("Getting most representative tags...");

        /* Sort the tags in descending order */
        tagpool = sortMapDescending(tagpool);

        /* Check the percentage, if correct, proceed */
        if (percentage > 100 || percentage < 0) System.out.println("The given percentage has to be between 0 and 100.");
        else {
            /* Calculate number of tags, at least MIN_REFERENCE_TAG_COUNT, otherwise */
            double percentageCount = tagpool.size() * percentage * 0.01;

            if (percentageCount > MIN_REFERENCE_TAG_COUNT) {
                double referenceCount = percentageCount;
            } else {
                double referenceCount = percentageCount;
            }

            /* Go through the map and find the number(percentageCount) highest-rated tags, add them to the list */
            Iterator iteratorMin = tagpool.entrySet().iterator();
            while (iteratorMin.hasNext() && representativeTags.size() < percentageCount) {
                Map.Entry pair = (Map.Entry) iteratorMin.next();
                representativeTags.add(pair.getKey());
            }
        }

        return representativeTags;
    }