Added query for averages
Merge branch 'padillbt'
WIP