query generator done