anchor.diff:      keywords["*"] = TokenType.TIMES;
       keywords["/"] = TokenType.DIV;
       keywords["^"] = TokenType.POW;
  -    keywords["rt"] = TokenType.ROOT;
  +    keywords["nrt"] = TokenType.ROOT;
       keywords["sqrt"] = TokenType.SQRT;
       keywords["log"] = TokenType.LOG;
       keywords["cos"] = TokenType.COS;
  
positive.code:   Parser(): lex = new Lexer();
  
    /**
     * Parses the given input string into an [Expression]. Throws a [StateError]
     * if the token stream is invalid. Returns a valid [Expression].
     */
    Expression parse(String inputString) {
      List<Expression> expressionStack = new List<Expression>();
      List<Token> inputStream = lex.tokenizeToRPN(inputString);
  
      for (var i = 0; i < inputStream.length; i++){
        Token currentToken = inputStream[i];
        Expression currentExpression;
  
        if(currentToken.type == TokenType.VAL) {
          currentExpression = new Number(double.parse(currentToken.text));
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.VAR) {
          Expression currentExpression = new Variable(currentToken.text);
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.PLUS) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = leftOperand + rightOperand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.MINUS) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = leftOperand - rightOperand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.TIMES) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = leftOperand * rightOperand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.DIV) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = leftOperand / rightOperand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.POW) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = leftOperand ^ rightOperand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.UNMINUS) {
          Expression operand = expressionStack.removeLast();
          currentExpression = - operand;
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.LOG) {
          Expression rightOperand = expressionStack.removeLast();
          Expression leftOperand = expressionStack.removeLast();
          currentExpression = new Log(leftOperand, rightOperand);
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.LN) {
          Expression operand = expressionStack.removeLast();
          currentExpression = new Ln(operand);
          expressionStack.add(currentExpression);
          continue;
        }
  
        if(currentToken.type == TokenType.SQRT) {
          Expression operand = expressionStack.removeLast();
          currentExpression = new Sqrt(operand);
          expressionStack.add(currentExpression);
          continue;
        }
        
        if(currentToken.type == TokenType.COS) {
          Expression operand = expressionStack.removeLast();
          currentExpression = new Cos(operand);
          expressionStack.add(currentExpression);
          continue;
        }
        
        if(currentToken.type == TokenType.SIN) {
          Expression operand = expressionStack.removeLast();
          currentExpression = new Sin(operand);
          expressionStack.add(currentExpression);
          continue;
        }
        
        if(currentToken.type == TokenType.EFUNC) {
          Expression operand = expressionStack.removeLast();
          currentExpression = new Exponential(operand);
          expressionStack.add(currentExpression);
          continue;
        }
      }
  
      if(expressionStack.length > 1){
        throw new StateError("The input String is not a correct expression");
      }
  
      return expressionStack.last;
    }
  }
  
  
negative.code:     if(stream.isEmpty) {
        throw new ArgumentError("The given tokenStream was empty.");
      }
      
      List<Token> outputStream = new List<Token>();
      List<Token> operatorBuffer = new List<Token>();
  
      for(Token curToken in stream) {
        // If the current Token is a value or a variable, put them into the output stream.
        if(curToken.type == TokenType.VAL || curToken.type == TokenType.VAR) {
          outputStream.add(curToken);
          continue;
        }
        
        // If the current Token is a function, put it onto the operator stack.
        if(curToken.type.function) {
          operatorBuffer.add(curToken);
          continue;
        }
        
        /*
         *  If the current Token is a function argument separator, pop operators
         *  to output stream until a left brace is encountered.
         */
        if(curToken.type == TokenType.SEPAR) {
          while(!operatorBuffer.isEmpty && operatorBuffer.last.type != TokenType.LBRACE) {
            outputStream.add(operatorBuffer.removeLast());
          }
          // If no left brace is encountered, separator was misplaced or parenthesis mismatch
          if(!operatorBuffer.isEmpty && operatorBuffer.last.type != TokenType.LBRACE) {
            //TODO never reached, check this.
            throw new StateError('Misplaced separator or mismatched parenthesis.');
          }
          continue;
        }
       
        /*
         * Special case for unary minus: If the current token type is MINUS and the last
         * token is of type LBRACE, the current token is considered an unary minus.
         * 
         * This allows unary minus in parenthesis to be parsed correctly.
         * 
         * TODO: This is buggy, find a better solution for unary minus.
         */
        /*
        if( curToken.type.operator && curToken.type == TokenType.MINUS &&
            !operatorBuffer.isEmpty && operatorBuffer.last.type == TokenType.LBRACE) {
          operatorBuffer.add(new Token(curToken.text, TokenType.UNMINUS));
        }
        */
        
        /* 
         * If the current token is an operator and it's priority is lower than the priority of the last
  