Working query parser