query interpreter written