implemented query functions