* modified query functions and tested them out