 					loc.rules[loc.count][2] = ListGetAt(loc.ruleList, loc.i+1);
 					loc.count = loc.count + 1;
 				}
+				
+				// loop through the rules looking for a match and perform the regex replace when we find one
 				loc.iEnd = ArrayLen(loc.rules);
 				for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
 				{
-					if(REFindNoCase(loc.rules[loc.i][1], loc.text))
+					if (REFindNoCase(loc.rules[loc.i][1], arguments.text))
 					{
-						loc.returnValue = REReplaceNoCase(loc.text, loc.rules[loc.i][1], loc.rules[loc.i][2]);
+						loc.returnValue = REReplaceNoCase(arguments.text, loc.rules[loc.i][1], loc.rules[loc.i][2]);
 						break;
 					}
 				}
+
+				// set back to blank string since we worked around the fact that we can't have blank values in lists above by using Chr(7) instead
 				loc.returnValue = Replace(loc.returnValue, Chr(7), "", "all");
 			}
-
-			// this was a camelCased string and we need to prepend the unchanged part to the result
+	
+			// if this is a camel cased string we need to prepend the unchanged part to the result
 			if (StructKeyExists(loc, "prepend"))
 				loc.returnValue = loc.prepend & loc.returnValue;
-
-		}
-
-		// return the count number in the string (e.g. "5 sites" instead of just "sites")
-		if (arguments.returnCount && arguments.count != -1)
-			loc.returnValue = LSNumberFormat(arguments.count) & " " & loc.returnValue;
-	</cfscript>
-	<cfreturn loc.returnValue>
+		}
+		return loc.returnValue;
+	</cfscript>
 </cffunction>
	<cfargument name="word" type="string" required="true" hint="The word to pluralize.">
	<cfargument name="count" type="numeric" required="false" default="-1" hint="Pluralization will occur when this value is not `1`.">
	<cfargument name="returnCount" type="boolean" required="false" default="true" hint="Will return `count` prepended to the pluralization when `true` and `count` is not `-1`.">
	<cfreturn $singularizeOrPluralize(text=arguments.word, which="pluralize", count=arguments.count, returnCount=arguments.returnCount)>
</cffunction>

<cffunction name="singularize" returntype="string" access="public" output="false" hint="Returns the singular form of the passed in word."

	'
	categories="global,string" chapters="miscellaneous-helpers" functions="capitalize,humanize,pluralize">
	<cfargument name="word" type="string" required="true" hint="String to singularize.">
	<cfreturn $singularizeOrPluralizeWithCount(text=arguments.word, which="singularize")>
</cffunction>

<cffunction name="toXHTML" returntype="string" access="public" output="false" hint="Returns an XHTML-compliant string."
