public static CharProbability[] sortedCharProbabilitiesOf(String theTextStr) {

        CharProbability[] charProbs = CryptoAnalysis.charProbabilitiesOf(theTextStr);
        boolean sorted = false;

        while (sorted == false) {

            boolean swapped = false;

            for (int i = 0; i < charProbs.length - 1; i++) {


                float curr, next;
                curr = charProbs[i].getProbability();
                next = charProbs[i + 1].getProbability();

                if (curr < next) {

                    CharProbability temp = charProbs[i];
                    charProbs[i] = charProbs[i + 1];
                    charProbs[i + 1] = temp;
                    swapped = true;

                }
            }

            if (swapped == false) {
                sorted = true;
            }
        }
        double bs = 1.0 / 100000.0;
        int zeroFinderIndex = -1;
        for (int t = 0; t < charProbs.length; t++) {
            if ((charProbs[t].getProbability() < bs) && (zeroFinderIndex == -1)) {
                zeroFinderIndex = t;

            }
        }

        CharProbability[] finalCharProbsArray = new CharProbability[zeroFinderIndex];
        for (int r = 0; r < zeroFinderIndex; r++) {
            finalCharProbsArray[r] = charProbs[r];
        }

        return finalCharProbsArray;
    }