more locations
replace static AVG wich avg_by_type() and avg_type