further work on the query