resizing array stack with iterator