public TreeElement fillTree(String expression) throws WrongStructure, IncorrectSymbol, ImpossibleAction{
        if (isComponent(expression.charAt(counter))) {
            counterUp();
            TreeElement currentOperation = new Operation(expression.charAt(counter));
            counterUp();
            if (isComponent(expression.charAt(counter))) {
                currentOperation.setLeftSon(fillTree(expression));
                counterUp();
            } else {
                if (isNumber(expression.charAt(counter))) {
                    int number = Integer.parseInt(String.valueOf(expression.charAt(counter)));
                    TreeElement currentNum = new Digit(number);
                    currentOperation.setLeftSon(currentNum);
                    counterUp();
                } else {
                    if (expression.charAt(counter) == ')') {
                        counterUp();
                    } else {
                      throw new IncorrectSymbol("Wrong symbol!");
                    }                  
                }
            }

            if (isComponent(expression.charAt(counter))) {
                currentOperation.setRightSon(fillTree(expression));
                counterUp();
            } else {
                if (isNumber(expression.charAt(counter))) {
                    int number = Integer.parseInt(String.valueOf(expression.charAt(counter)));
                    TreeElement currentNum = new Digit(number);
                    currentOperation.setRightSon(currentNum);
                    counterUp();
                } else {
                    if (expression.charAt(counter) == ')') {
                        counterUp();
                    } else {
                      throw new IncorrectSymbol("Wrong symbol!");
                    }                  
                }
            }        
            return currentOperation;
        }
        throw new WrongStructure("Wrong input structure!");
    }