public List<String> stringToPolish(String function){
        List<String> polishList = new ArrayList<String>();
        List<String> elements = split(function);
        for (String s: elements) {
            if (isOperator(s)) {
                if (s.equals("(")) {
                    operations.push(s);
                }
                else if (s.equals(")")) {
                    while (stackElementPriority() > 1) {
                        polishList.add(String.valueOf(operations.pop()));
                    }
                    operations.pop();
                }
                else if (stackElementPriority() <= currentPriority(s)) {
                    operations.push(s);
                }
                else if (stackElementPriority() > currentPriority(s)) {
                    while (stackElementPriority() >= currentPriority(s)) {
                        polishList.add(String.valueOf(operations.pop()));
                    }
                    operations.push(s);
                }
            } else {
                polishList.add(s);
            }
        }
        while (!operations.isEmpty()){
            polishList.add(String.valueOf(operations.pop()));
        }
        return polishList;
    }