This function will loop over the entire source and collect attributes for each id. The resulting list will be returned to the caller. I also added a list_queue() function so the user doesn't need to pass the QUEUE flag.