Added query for averages