private int findMatchingBracketIndex(String expWBrac, int start) throws Exception {

        //One bracket is opened.
        int openedCount = 1;
        for (int i = start + 1; i < expWBrac.length(); i++) {

            //Bracket Closed.
            if (expWBrac.charAt(i) == ')') {
                openedCount--;

                //All brackets closesd.
                if (openedCount == 0) {
                    return i;
                }

                //New bracket opened.
            } else if (expWBrac.charAt(i) == '(') {
                openedCount++;
            }
        }

        throw new Exception("Cannot find matching bracket");
    }