private void handleOperator(OPERATOR op, MyStack output) {
        if (operatorStack.isEmpty() || op == OPERATOR.OPEN_BR) operatorStack.push(op);

        else if (op == OPERATOR.CLOSE_BR) {
            while (operatorStack.peek() != OPERATOR.OPEN_BR) {
                output.push(operatorStack.pop());
            }//next one is OPEN_BRacket, so pop it
            operatorStack.pop();
        } else {
            while (!operatorStack.isEmpty() && operatorStack.peek().precedence >= op.precedence) {
                output.push(operatorStack.pop());
            }//current operator is less or equal in precedence to the top one on the stack, so it can be pushed
            operatorStack.push(op);
        }
    }