public void optimize()
  {
    String optimized = "";
    int i = 0;
    while (i < oldString.length())
    {
      int repeats = 1;
      char c = oldString.charAt(i);
      i++;
      if (isLoopable(c))
      {
        while (i < oldString.length() && c == oldString.charAt(i))
        {
          repeats++;
          i++;
        }
      }

      if (repeats > 1)
      {
        optimized += repeats;
        optimized += c;
      }
      else
      {
        optimized += c;
      }
    }
    System.out.println();
    System.out.println(" - Unoptimized: - ");
    System.out.println(oldString);
    System.out.println(" - Optimized: - ");
    System.out.println(optimized);
    System.out.println();
  }