public static LinkedHashMap sortProperties (Properties p) {
        Properties oldProps = new Properties();
        Enumeration e = p.propertyNames();
        while (e.hasMoreElements()) {
            String key = (String) e.nextElement();
            String score =  p.getProperty(key);
            oldProps.setProperty(key, score);
        }
        
        System.out.println("Number of scores: " + p.values().size());
        p.clear();
        
        Enumeration e0 = oldProps.propertyNames();
        Integer[] scoresInOrder = new Integer[oldProps.values().size()];
        System.out.println("Number of scores: " + oldProps.values().size());
        int index = 0;
        while (e0.hasMoreElements()) {
            String key = (String) e0.nextElement();
            String score =  oldProps.getProperty(key);
            scoresInOrder[index] = (Integer.parseInt(score));
            index++;
            System.out.println("Added a score to array.");
        }
        Arrays.sort(scoresInOrder);
        for (int i = scoresInOrder.length - 1; i >= 0; i--) {
            System.out.print(scoresInOrder[i] + " ");
        }
        System.out.println();
        
        LinkedHashMap<String, String> sortedScores = new LinkedHashMap<String, String>();
        for (int i = scoresInOrder.length -1  ; i >= 0 ; i--) {
            int currentScore = scoresInOrder[i];
            System.out.println("Selected Score: " + currentScore);
            Enumeration e2 = oldProps.propertyNames();
            while (e2.hasMoreElements()) {
                String key = (String) e2.nextElement();
                if (Integer.parseInt(oldProps.getProperty(key)) == currentScore) {
                    if (scoresInOrder.length - i <= maxSavedScores) {
                        p.setProperty(key, oldProps.getProperty(key));
                        System.out.println("Added a property to p, score was: " + oldProps.getProperty(key));
                        sortedScores.put(key, oldProps.getProperty(key));
                        System.out.println("Now finished adding to scores.");
                    }
                    oldProps.remove(key);
                }
            }
        }
        System.out.println("sortedScores length: " + sortedScores.size());
        return sortedScores;
    }