Addes query functions and and comments

Addes query functions and and comments