global query fxn uses main query building fxn