some query building things working