changed remove leftmost to iterative