 		<cfset flashClear()>
 	'
 	categories="controller-request,flash" chapters="using-the-flash" functions="flash,flashCount,flashDelete,flashInsert,flashIsEmpty,flashKeep,flashKeyExists,flashMessages">
-	<cfscript>
-		$writeFlash();
-	</cfscript>
+	<cfset $writeFlash()>
 </cffunction>
 
 <cffunction name="flashCount" returntype="numeric" access="public" output="false" hint="Returns how many keys exist in the Flash."

	'
	categories="controller-request,flash" chapters="using-the-flash" functions="flash,flashClear,flashCount,flashDelete,flashInsert,flashIsEmpty,flashKeep,flashMessages">
	<cfargument name="key" type="string" required="true" hint="The key to check if it exists.">
	<cfscript>
		var loc = {};
		loc.flash = $readFlash();
		loc.rv = StructKeyExists(loc.flash, arguments.key);
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="flashMessages" returntype="string" access="public" output="false" hint="Displays a marked-up listing of messages that exists in the Flash."

		// only save the old flash if they want to keep anything
		if (StructKeyExists(request.wheels, "flashKeep"))
		{
			loc.$flash = $readFlash();
		}
		
		// clear the current flash
		flashClear();
		
		// see if they wanted to keep anything
		if (StructKeyExists(loc, "$flash"))
		{
			// delete any keys they don't want to keep
			if (Len(request.wheels.flashKeep))
			{
				for (loc.key in loc.$flash)
				{
					if (!ListFindNoCase(request.wheels.flashKeep, loc.key))
					{
						StructDelete(loc.$flash, loc.key, false);
					}
				}
			}
			
			// write to the flash
			$writeFlash(loc.$flash);
		}
	</cfscript>
</cffunction>

<cffunction name="$setFlashStorage" returntype="void" access="public" output="false">
	<cfargument name="storage" type="string" required="true">
	<cfset variables.$class.flashStorage = arguments.storage>
</cffunction>

<cffunction name="$getFlashStorage" returntype="string" access="public" output="false">
	<cfreturn variables.$class.flashStorage>
</cffunction>