pop now correctly returns the value popped