Updated queries.py to generate bit strings