updating Query method

the responsibility is now on the function calling the query to provide
all of the needed information, this makes the method more versitile in
working for multipule query potentals (it works for everything)