more work on queries