Refactored code in citaQuery.
Misc. code formating.