Stack implementation using a singly linked list