added a bit of test code in Query