 			}
 			arguments.select = arguments.select & loc.properties;
 		}
+		
+		// alias the result with `AS`, this means that Wheels will not try and change the string (which is why we have to add the table name above since it won't be done automatically) 
 		arguments.select = arguments.select & ") AS result";
+		
+		// call `findAll` with `select`, `where` and `include` but delete all other arguments
 		StructDelete(arguments, "type");
 		StructDelete(arguments, "property");
 		StructDelete(arguments, "distinct");
 		loc.query = findAll(argumentCollection=arguments);
+		
+		// we return the result from the query but if it's a blank string we convert it to `0` first
 		if (Len(loc.query.result))
 			loc.returnValue = loc.query.result;
 		else

<cffunction name="average" returntype="numeric" access="public" output="false"
	hint="Calculates the average value for a given property. Uses the SQL function `AVG`."
	examples=

		<!--- Get the sum of all salaries for employees in Australia --->
		<cfset allAustralianSalaries = model("employee").sum(property="salary", include="country", where="name=''Australia''")>
	'
	categories="model-class,statistics" chapters="column-statistics" functions="average,count,maximum,minimum">
	<cfargument name="property" type="string" required="true" hint="Name of the property to get the sum for (has to be a property of a numeric data type).">
	<cfargument name="where" type="string" required="false" default="" hint="See documentation for @average.">
	<cfargument name="include" type="string" required="false" default="" hint="See documentation for @average.">
