public static void query(String tagFile, String[] rpnQuery) {
        Expression expression = null;
        try {
            expression = Querior.parse(rpnQuery);
        }
        catch(ParseException e) {
            System.out.println("Problem parsing expression: " + e);
            return;
        }
        if (expression == null)
            return;
        TagState state = null;
        try {
            FileInputStream fis = new FileInputStream(tagFile);
            BufferedInputStream bis = new BufferedInputStream(fis, 4096*4);
            ObjectInputStream tagInput = new ObjectInputStream(bis);
            state = (TagState) tagInput.readObject();
            tagInput.close();
        }
        catch(IOException e) {
            System.out.println("Problem reading from tagFile: " + e);
            e.printStackTrace();
            return;
        }
        catch(ClassNotFoundException e) {
            System.out.println("Problem reading TagState from tagFile: " + e);
            return;
        }
        List documentResults = Querior.search(state, expression);
        if (documentResults == null || documentResults.size() == 0) {
            System.out.println("No results");
            return;
        }
        for (int i = 0; i < documentResults.size(); i++) {
            DocumentResult docRes = (DocumentResult) documentResults.get(i);
            System.out.println(docRes.getDocument().getOrigin());
            List images = docRes.getImages();
            System.out.println("  Matching images: " + images.size());
            for (int j = 0; j < images.size(); j++) {
                TaggedImage ti = (TaggedImage) images.get(j);
                System.out.println("  Image: " + (ti.getReference() != null ? ti.getReference().toString() : "<unreferenced>") + "  Inline: " + ti.isInlineImage() + "  Pages: " + ti.describePages());
            }
        }
    }