generalized pushes and pops