I have two functions to pop() in a single-linked list stack. But can't figure out why one is more correct than the other.

```
POP1:
X = head;
head = head->getNext();
return X;

POP2:
head = head->getNext();
X = head;
return X;

```

My answer is POP1, but I'm not sure why POP2 would be incorrect. Thanks for any help you can give me.