private static String quote(String str, boolean insideQuotes) {
    String retVal = str;
    if (!insideQuotes) {
      retVal = '\'' + retVal + '\'';
    }
    return retVal;
  }
private static String quote(String str, boolean insideQuotes)