Batching queries to speed things up

Batching queries