working on hit count, and query optimization