Implimented query atc weighting