added general push-pop interface, modified queue accordingly