updated bquery.c