public static ArrayList<Symbol> extractSymbols(ArrayList<Boolean> history, int dotLength) {
        ArrayList<Symbol> symbols = new ArrayList<Symbol>();
        int dotDashBdy = 2 * dotLength;
        int pauseBdy = 3 * dotLength;
        int runStart = -1;
        boolean runBeeping = false;
        for (int i = 0; i < history.size(); i++) {
            // Beep starts
            if (history.get(i) && !runBeeping) {
                if (i - runStart > pauseBdy) {
                    symbols.add(new Symbol(SymbolType.PAUSE, runStart, i));
                }
                runStart = i;
            }
            // Beep stops
            if (!history.get(i) && runBeeping) {
                if (i - runStart > dotDashBdy) {
                    symbols.add(new Symbol(SymbolType.DASH, runStart, i));
                } else {
                    symbols.add(new Symbol(SymbolType.DOT, runStart, i));
                }
                runStart = i;
            }
            runBeeping = history.get(i);
        }
        return symbols;
    }