Updated q in queries to allow chaining