Added new compare argument to push and pop