public static long[] packChords(String b) {
        String[] ab = chordsToArray(b);
        int longCount = (int) Math.ceil(ab.length/14.0);
        long[] ngrams = new long[longCount];
    	
        for (int j = 0; j < longCount; j++){
        	long out = 0;
            byte underscores = 0;
            int count = 0;
            int underscoreCount = 0;
	        String[] a = Arrays.copyOfRange(ab, j*14, j+1 != longCount ? (j+1)*14 : ab.length);
	        for (int i = 0; i < Math.min(14, j+1 == longCount ? ab.length % 14 :14); i++) {  
	        	if (a[i].equals("_")) {
	        		underscores = (byte) (underscores << 1);
	            	underscores += 1;
	            	underscoreCount++;
	            } else if (i != 0 && a[i].equals(" ")){
	                underscores = (byte) (underscores << 1);
	                underscoreCount++;
	            } else {
	                out += Long.parseLong(a[i]) << 7 * (8 - count);
	                count++;
	            }
	            
	        }

	        underscores *= Math.pow(2, 7-underscoreCount);
	        ngrams[j] = out | underscores;
        }

        return ngrams;
    }