added code for running existential queries
Tidied up output for existential queries