renaming q to query