switched pop and shift