some progress but nothing concrete on creating query object