use queue since list&vector iterators are weird