You could use a loop like `for query_name, query_value in orig_query`, and then use `query_value` instead of `query_item[1]`, which I think would make the operation clearer.