Store queue in a set to avoid duplicates