Updated queries.py