refactor of average calculation avoid loop when distinct is false use arrays to calculate the average use struct for distinct values
refactor of average calculation
avoid loop when distinct is false
use arrays to calculate the average
use struct for distinct values

cfwheels/cfwheels,cfwheels/cfwheels,cfwheels/cfwheels