private int code(char ch) {
        switch (ch) {
            case 'A': return 0;
            case 'T': return 1;
            case 'C': return 2;
            case 'G': return 3;
            default: return -1;
        }
    }