Added support for various distributions of queries, and some logs.