Implemented code for threading the querier