rounded out parameter code with query functions
clean up param code