public Equation(String input) {
      this.input = input;
      this.unmapped = new HashSet<Character>();
      this.openparen = new HashSet<Character>();
      this.closeparen = new HashSet<Character>();
      this.hasParen = false;
      
      boolean digit = false;
      for (int i = 0; i < input.length(); i++) {
        if (input.charAt(i) == ' ') {
          continue;
        }
        if (Character.isDigit(input.charAt(i))) {
          digit = true;
        } else {
          if (!digit) {
            hasParen = true;
            if (i != 0) {
              int j = i;
              while (j > 0) {
                if (Character.isDigit(input.charAt(j))) {
                  break;
                }
                if (input.charAt(j) != ' ') {
                  openparen.add(input.charAt(j));
                  closeparen.add(input.charAt(j));
                }
                j--;
              }
            } else {
              openparen.add(input.charAt(i));
            }
          }
          unmapped.add(input.charAt(i));
          digit = false;
        }
      }
      if (!digit) {
        closeparen.add(input.charAt(input.length() - 1));
      }
    }