static int findEndBracket(final int i, final String program) {
        int nrOpenBrackets = 1;
        int p = i + 1;
        while (nrOpenBrackets > 0) {
            if (program.charAt(p) == '[') {
                nrOpenBrackets++;
            }

            if (program.charAt(p) == ']') {
                nrOpenBrackets--;
            }

            p++;
        }

        return p - 1;
    }