Implementing the stack interface with a linked list