Added weight computation of query