hacking in the query functions, also getting all tests to pass