Added in histogram generating queries