push pop function modified