corrected iterator so that multiple iterators can track the original array independently
fixed loitering problem by taking care of node removal
fixed deque
Fixed loitering problem by nulling the last item of the queue