pop and shift