a few minor fixes...pondering how to print out queries