Added support for queries in an input file