Change make_query into a list comprehension