updated query formulation method