updated generateQueries to return list of query objects instead of strings